API Reference

Verdad is a personal source-of-truth vault, agent-native by construction. Every operation below is exposed as both an MCP tool (POST to /mcp, JSON-RPC 2.0) and a REST endpoint. The contract is the same; the transport is your choice. Auth is a bearer token per scope: admin > author > reader.

Works

Published artifacts — what you read, watch, cook, listen to.

.recipe

recipe.add

scope · author effect · write audited v1

Add a recipe by providing canonical fields directly (no URL ingestion).

Primary write path for recipes. The caller provides the canonical fields directly; the system handles ID generation, provenance, and storage. Soft URL dedup: when `canonical.source.url` is set and a recipe with the same URL already exists, returns that row with `created: false` rather than inserting a duplicate. URL-less recipes (book-sourced) skip the dedup and always insert. Provenance: if the caller passes a `provenance` partial, its fields shallow-merge OVER the default `{source: mcp:<client>, schemaVersion}`. Use case: `recipe.ingest_from_url` stamps `source: ingest:url` + `enrichedBy: json-ld` via this override. Per architect HIGH 2026-05-27.

REST · POST /recipes
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "cuisine": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "course": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "technique": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dietary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "yield": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": false
        },
        "times": {
          "type": "object",
          "properties": {
            "prep": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "active": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "passive": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "total": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "ingredient": {
                "type": "string"
              },
              "prep": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "optional": {
                "type": "boolean"
              }
            },
            "required": [
              "raw"
            ],
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "text": {
                "type": "string"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "order",
              "text"
            ],
            "additionalProperties": false
          }
        },
        "equipment": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "notes": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoUrl": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "derivedFrom": {
          "type": "string"
        }
      },
      "required": [
        "title",
        "source",
        "yield",
        "times",
        "ingredients",
        "steps"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "cookLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "servedTo": {
                "type": "array",
                "items": {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                "default": []
              },
              "modifications": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "photo": {
                "type": "string",
                "format": "uri"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "shoppingNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipe": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "recipe"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "source": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "book",
                    "website",
                    "magazine",
                    "video",
                    "podcast",
                    "personal",
                    "other"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "publisher": {
                  "anyOf": [
                    {
                      "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "publishedYear": {
                  "type": "integer"
                },
                "publishedDate": {
                  "type": "string"
                },
                "pageNumber": {
                  "type": "integer"
                },
                "isbn": {
                  "type": "string"
                },
                "doi": {
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            },
            "cuisine": {
              "type": "array",
              "items": {
                "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "course": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "technique": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "dietary": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "yield": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "unit": {
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "unit"
              ],
              "additionalProperties": false
            },
            "times": {
              "type": "object",
              "properties": {
                "prep": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "active": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "passive": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "total": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "ingredients": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "raw": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "ingredient": {
                    "type": "string"
                  },
                  "prep": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "optional": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "raw"
                ],
                "additionalProperties": false
              }
            },
            "steps": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "text": {
                    "type": "string"
                  },
                  "duration": {
                    "type": "object",
                    "properties": {
                      "minutes": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "minutes"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "order",
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "equipment": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "notes": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "videoUrl": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "derivedFrom": {
              "type": "string"
            }
          },
          "required": [
            "title",
            "source",
            "yield",
            "times",
            "ingredients",
            "steps"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "cookLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "servedTo": {
                    "type": "array",
                    "items": {
                      "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
                    },
                    "default": []
                  },
                  "modifications": {
                    "type": "string"
                  },
                  "outcome": {
                    "type": "string"
                  },
                  "photo": {
                    "type": "string",
                    "format": "uri"
                  },
                  "duration": {
                    "type": "object",
                    "properties": {
                      "minutes": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "minutes"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "modifications": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "shoppingNotes": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "recipe",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.get

scope · reader effect · read v1

Retrieve a full recipe by ID, including canonical and overlay.

REST · GET /recipes/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "recipe"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "cuisine": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "course": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "technique": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dietary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "yield": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": false
        },
        "times": {
          "type": "object",
          "properties": {
            "prep": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "active": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "passive": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "total": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "ingredient": {
                "type": "string"
              },
              "prep": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "optional": {
                "type": "boolean"
              }
            },
            "required": [
              "raw"
            ],
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "text": {
                "type": "string"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "order",
              "text"
            ],
            "additionalProperties": false
          }
        },
        "equipment": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "notes": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoUrl": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "derivedFrom": {
          "type": "string"
        }
      },
      "required": [
        "title",
        "source",
        "yield",
        "times",
        "ingredients",
        "steps"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "cookLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "servedTo": {
                "type": "array",
                "items": {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                "default": []
              },
              "modifications": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "photo": {
                "type": "string",
                "format": "uri"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "shoppingNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.ingest_from_url

scope · author effect · write audited v1

Ingest a recipe from a URL. Extracts schema.org/Recipe JSON-LD; full content stored locally.

Paste-a-URL flow for recipes. The URL is canonicalized (utm_*, fbclid, gclid stripped). The page is fetched and parsed for schema.org/Recipe JSON-LD: ingredients[], steps[], times, yield, cuisine, author. The raw page text (~8KB cleaned) is preserved in `canonical.sourceText` per Principle #8 so future re-enrichment can re-extract without re-fetching. Per architect H3 review (2026-05-27), the handler delegates the actual write to `recipe.add` via the operation runner so the same soft-dedup + provenance-merge path applies. Returns `{recipe, created, extraction}` — `created: false` when the URL matched an existing recipe (soft dedup), in which case `extraction.source === "cached"`.

REST · POST /recipes/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri"
    },
    "overlay": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "wishlist": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "templateId": {
      "type": "string"
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipe": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "recipe"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "source": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "book",
                    "website",
                    "magazine",
                    "video",
                    "podcast",
                    "personal",
                    "other"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "publisher": {
                  "anyOf": [
                    {
                      "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "publishedYear": {
                  "type": "integer"
                },
                "publishedDate": {
                  "type": "string"
                },
                "pageNumber": {
                  "type": "integer"
                },
                "isbn": {
                  "type": "string"
                },
                "doi": {
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            },
            "cuisine": {
              "type": "array",
              "items": {
                "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "course": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "technique": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "dietary": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "yield": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "unit": {
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "unit"
              ],
              "additionalProperties": false
            },
            "times": {
              "type": "object",
              "properties": {
                "prep": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "active": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "passive": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                },
                "total": {
                  "type": "object",
                  "properties": {
                    "minutes": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "minutes"
                  ],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "ingredients": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "raw": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "ingredient": {
                    "type": "string"
                  },
                  "prep": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  },
                  "optional": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "raw"
                ],
                "additionalProperties": false
              }
            },
            "steps": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "text": {
                    "type": "string"
                  },
                  "duration": {
                    "type": "object",
                    "properties": {
                      "minutes": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "minutes"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "order",
                  "text"
                ],
                "additionalProperties": false
              }
            },
            "equipment": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "notes": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "videoUrl": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "derivedFrom": {
              "type": "string"
            }
          },
          "required": [
            "title",
            "source",
            "yield",
            "times",
            "ingredients",
            "steps"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "cookLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "servedTo": {
                    "type": "array",
                    "items": {
                      "$ref": "#/properties/recipe/properties/canonical/properties/authors/items"
                    },
                    "default": []
                  },
                  "modifications": {
                    "type": "string"
                  },
                  "outcome": {
                    "type": "string"
                  },
                  "photo": {
                    "type": "string",
                    "format": "uri"
                  },
                  "duration": {
                    "type": "object",
                    "properties": {
                      "minutes": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "minutes"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "modifications": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "shoppingNotes": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "json-ld",
            "title-only",
            "cached"
          ]
        },
        "hadJsonLd": {
          "type": "boolean"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "hadJsonLd",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "recipe",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.log_cook

scope · author effect · write audited v1

Append a cook log entry to a recipe overlay.

The most common write — record that you cooked this, how it went, who you served it to, what you modified. Cook log is append-only; prior entries are immutable. Updates the overall recipe rating if a per-cook rating is given.

REST · POST /recipes/:recipeId/cooks
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipeId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "servedTo": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "photo": {
          "type": "string",
          "format": "uri"
        },
        "duration": {
          "type": "object",
          "properties": {
            "minutes": {
              "type": "number"
            }
          },
          "required": [
            "minutes"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "recipeId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "cookLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "servedTo": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "photo": {
          "type": "string",
          "format": "uri"
        },
        "duration": {
          "type": "object",
          "properties": {
            "minutes": {
              "type": "number"
            }
          },
          "required": [
            "minutes"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "cookLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.search

scope · reader effect · read v1

Search recipes by query, cuisine, technique, time, or rating.

Recipe search via SQL filters: ILIKE on canonical.title, JSONB containment on cuisine + technique + tags, overlay status/rating, canonical times. Filters compose with the query (AND). Pagination is cursor-based; sorts by updated_at DESC, id DESC. The `mode` field is currently a single-value enum (`sql`); semantic + hybrid modes land with the embeddings milestone. Returns concise hit summaries; use recipe.get for full details.

REST · GET /recipes/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "cuisine": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "technique": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "maxTotalMinutes": {
      "type": "number"
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    },
    "status": {
      "type": "string",
      "enum": [
        "untried",
        "tried",
        "regular",
        "retired"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cuisines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalMinutes": {
            "type": "number"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "authors",
          "cuisines"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a recipe (admin-tier).

Whole-canonical replacement. The caller sends the complete RecipeCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /recipes/:recipeId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipeId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "cuisine": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "course": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "technique": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dietary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "yield": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": false
        },
        "times": {
          "type": "object",
          "properties": {
            "prep": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "active": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "passive": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "total": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "ingredient": {
                "type": "string"
              },
              "prep": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "optional": {
                "type": "boolean"
              }
            },
            "required": [
              "raw"
            ],
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "text": {
                "type": "string"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "order",
              "text"
            ],
            "additionalProperties": false
          }
        },
        "equipment": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "notes": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoUrl": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "derivedFrom": {
          "type": "string"
        }
      },
      "required": [
        "title",
        "source",
        "yield",
        "times",
        "ingredients",
        "steps"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "recipeId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "recipe"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "cuisine": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "course": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "technique": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dietary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "yield": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": false
        },
        "times": {
          "type": "object",
          "properties": {
            "prep": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "active": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "passive": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "total": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "ingredient": {
                "type": "string"
              },
              "prep": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "optional": {
                "type": "boolean"
              }
            },
            "required": [
              "raw"
            ],
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "text": {
                "type": "string"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "order",
              "text"
            ],
            "additionalProperties": false
          }
        },
        "equipment": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "notes": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoUrl": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "derivedFrom": {
          "type": "string"
        }
      },
      "required": [
        "title",
        "source",
        "yield",
        "times",
        "ingredients",
        "steps"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "cookLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "servedTo": {
                "type": "array",
                "items": {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                "default": []
              },
              "modifications": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "photo": {
                "type": "string",
                "format": "uri"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "shoppingNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

recipe.update_overlay

scope · author effect · write audited v1

Update overlay fields on a recipe (status, rating, favorite, notes, etc.).

Partial update — only fields you pass are changed. Does not touch canonical fields; for those, see recipe.update_canonical (admin-tier).

REST · PATCH /recipes/:recipeId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipeId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "cookLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "servedTo": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "ref": {
                      "type": "string"
                    },
                    "matchConfidence": {
                      "type": "string",
                      "enum": [
                        "exact",
                        "fuzzy",
                        "unresolved",
                        "pending_review"
                      ]
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "additionalProperties": false
                },
                "default": []
              },
              "modifications": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "photo": {
                "type": "string",
                "format": "uri"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "shoppingNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "recipeId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "recipe"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "cuisine": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "course": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "technique": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "dietary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "yield": {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "unit": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "unit"
          ],
          "additionalProperties": false
        },
        "times": {
          "type": "object",
          "properties": {
            "prep": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "active": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "passive": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            },
            "total": {
              "type": "object",
              "properties": {
                "minutes": {
                  "type": "number"
                }
              },
              "required": [
                "minutes"
              ],
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "raw": {
                "type": "string"
              },
              "quantity": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "ingredient": {
                "type": "string"
              },
              "prep": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              },
              "optional": {
                "type": "boolean"
              }
            },
            "required": [
              "raw"
            ],
            "additionalProperties": false
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "text": {
                "type": "string"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "order",
              "text"
            ],
            "additionalProperties": false
          }
        },
        "equipment": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "notes": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "videoUrl": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "derivedFrom": {
          "type": "string"
        }
      },
      "required": [
        "title",
        "source",
        "yield",
        "times",
        "ingredients",
        "steps"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "cookLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "servedTo": {
                "type": "array",
                "items": {
                  "$ref": "#/properties/canonical/properties/authors/items"
                },
                "default": []
              },
              "modifications": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "photo": {
                "type": "string",
                "format": "uri"
              },
              "duration": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "minutes"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "modifications": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "shoppingNotes": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.article

article.add

scope · author effect · write audited v1

Add an article by providing canonical fields directly.

Primary write path for articles. The caller provides canonical fields (URL, title, etc.); the system handles ID generation, provenance, and storage. Articles are identified by canonical.url. If an article with the same URL already exists, returns it with `created: false` rather than inserting a duplicate. Hard UNIQUE constraint lands in Week 4 with the resolution queue migration; until then the dedup is a SELECT-then-INSERT inside the runner's transaction.

REST · POST /articles
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "archivedUrl": {
          "type": "string",
          "format": "uri"
        },
        "headline": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "articleSection": {
          "type": "string"
        },
        "publication": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "excerpt": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "wordCount": {
          "type": "integer"
        },
        "readingTimeMinutes": {
          "type": "number"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "placesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "peopleReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "entitiesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "type": {
          "type": "string",
          "enum": [
            "news",
            "analysis",
            "opinion",
            "feature",
            "interview",
            "essay",
            "blog-post",
            "newsletter",
            "press-release",
            "other"
          ]
        }
      },
      "required": [
        "title",
        "url"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "article": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "article"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "archivedUrl": {
              "type": "string",
              "format": "uri"
            },
            "headline": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "articleSection": {
              "type": "string"
            },
            "publication": {
              "$ref": "#/properties/article/properties/canonical/properties/authors/items"
            },
            "publishedAt": {
              "type": "string",
              "format": "date-time"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time"
            },
            "excerpt": {
              "type": "string"
            },
            "fullText": {
              "type": "string"
            },
            "wordCount": {
              "type": "integer"
            },
            "readingTimeMinutes": {
              "type": "number"
            },
            "topics": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "placesReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "peopleReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "entitiesReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "type": {
              "type": "string",
              "enum": [
                "news",
                "analysis",
                "opinion",
                "feature",
                "interview",
                "essay",
                "blog-post",
                "newsletter",
                "press-release",
                "other"
              ]
            }
          },
          "required": [
            "title",
            "url"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "queue": {
              "type": "string",
              "enum": [
                "to-read",
                "reading",
                "read",
                "skipped"
              ]
            },
            "readLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "durationMinutes": {
                    "type": "number"
                  },
                  "context": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "highlights": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "position": {
                    "type": "number"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "text",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "citedIn": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "article",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

article.get

scope · reader effect · read v1

Retrieve a full article by ID, including canonical and overlay.

REST · GET /articles/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "article"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "archivedUrl": {
          "type": "string",
          "format": "uri"
        },
        "headline": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "articleSection": {
          "type": "string"
        },
        "publication": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "excerpt": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "wordCount": {
          "type": "integer"
        },
        "readingTimeMinutes": {
          "type": "number"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "placesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "peopleReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "entitiesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "type": {
          "type": "string",
          "enum": [
            "news",
            "analysis",
            "opinion",
            "feature",
            "interview",
            "essay",
            "blog-post",
            "newsletter",
            "press-release",
            "other"
          ]
        }
      },
      "required": [
        "title",
        "url"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

article.ingest_from_url

scope · author effect · write audited v1

Ingest an article from a URL. Fetches the page, extracts metadata via the enrichment ladder (meta-tags → Jina → URL path), persists via article.add. Phase A0: no AI classification.

Paste-a-URL flow for articles. The URL is canonicalized (utm_*, fbclid, gclid stripped). Enrichment cascades through three tiers and lands at least a title every time. The article is created via article.add — same soft URL-dedup + validation + audit path as direct creation. Returns the created (or pre-existing-matching) article plus the enrichment trail. In Phase A0, `canonical.topics`, `peopleReferenced`, `entitiesReferenced`, and `placesReferenced` land empty. Classifier + entity-ref extraction land in Phase A1 once ANTHROPIC_API_KEY is wired in Railway.

REST · POST /articles/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The URL to ingest. Will be canonicalized (utm_*, fbclid, gclid stripped) before storage."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10,
      "description": "Optional tags to attach to the new article row."
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false,
      "description": "Optional initial overlay — e.g. {queue: \"to-read\"} to add to a read-later queue."
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "article": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "article"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "archivedUrl": {
              "type": "string",
              "format": "uri"
            },
            "headline": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "articleSection": {
              "type": "string"
            },
            "publication": {
              "$ref": "#/properties/article/properties/canonical/properties/authors/items"
            },
            "publishedAt": {
              "type": "string",
              "format": "date-time"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time"
            },
            "excerpt": {
              "type": "string"
            },
            "fullText": {
              "type": "string"
            },
            "wordCount": {
              "type": "integer"
            },
            "readingTimeMinutes": {
              "type": "number"
            },
            "topics": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "placesReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "peopleReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "entitiesReferenced": {
              "type": "array",
              "items": {
                "$ref": "#/properties/article/properties/canonical/properties/authors/items"
              },
              "default": []
            },
            "type": {
              "type": "string",
              "enum": [
                "news",
                "analysis",
                "opinion",
                "feature",
                "interview",
                "essay",
                "blog-post",
                "newsletter",
                "press-release",
                "other"
              ]
            }
          },
          "required": [
            "title",
            "url"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "queue": {
              "type": "string",
              "enum": [
                "to-read",
                "reading",
                "read",
                "skipped"
              ]
            },
            "readLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "durationMinutes": {
                    "type": "number"
                  },
                  "context": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "highlights": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "position": {
                    "type": "number"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "text",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "citedIn": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "enrichment": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "meta-tags",
            "jina",
            "url-path",
            "mercury",
            "firecrawl",
            "ai"
          ]
        },
        "trail": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tier": {
                "type": "string"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "success",
                  "no-content",
                  "timeout",
                  "error"
                ]
              },
              "ms": {
                "type": "number"
              },
              "error": {
                "type": "string"
              }
            },
            "required": [
              "tier",
              "outcome",
              "ms"
            ],
            "additionalProperties": false
          }
        },
        "totalMs": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "trail",
        "totalMs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "article",
    "created",
    "enrichment"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

article.search

scope · reader effect · read v1

Search articles by title (ILIKE), type, publication, topics, or queue status.

Article search via SQL filters: ILIKE on canonical.title (no trigram index on articles in Phase 1), JSONB containment on topics, eq on type / publication.ref / overlay.queue. Sorted by updated_at DESC, id DESC. Use article.get for full details.

REST · GET /articles/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "news",
        "analysis",
        "opinion",
        "feature",
        "interview",
        "essay",
        "blog-post",
        "newsletter",
        "press-release",
        "other"
      ]
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "publicationId": {
      "type": "string"
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "queue": {
      "type": "string",
      "enum": [
        "to-read",
        "reading",
        "read",
        "skipped"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "publication": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "queue": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "title"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

article.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on an article (admin-tier).

Whole-canonical replacement. The caller sends the complete ArticleCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /articles/:articleId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "articleId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "archivedUrl": {
          "type": "string",
          "format": "uri"
        },
        "headline": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "articleSection": {
          "type": "string"
        },
        "publication": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "excerpt": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "wordCount": {
          "type": "integer"
        },
        "readingTimeMinutes": {
          "type": "number"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "placesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "peopleReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "entitiesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "type": {
          "type": "string",
          "enum": [
            "news",
            "analysis",
            "opinion",
            "feature",
            "interview",
            "essay",
            "blog-post",
            "newsletter",
            "press-release",
            "other"
          ]
        }
      },
      "required": [
        "title",
        "url"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "articleId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "article"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "archivedUrl": {
          "type": "string",
          "format": "uri"
        },
        "headline": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "articleSection": {
          "type": "string"
        },
        "publication": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "excerpt": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "wordCount": {
          "type": "integer"
        },
        "readingTimeMinutes": {
          "type": "number"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "placesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "peopleReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "entitiesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "type": {
          "type": "string",
          "enum": [
            "news",
            "analysis",
            "opinion",
            "feature",
            "interview",
            "essay",
            "blog-post",
            "newsletter",
            "press-release",
            "other"
          ]
        }
      },
      "required": [
        "title",
        "url"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

article.update_overlay

scope · author effect · write audited v1

Update overlay fields on an article (queue, highlights, read log, etc.).

Shallow-merge patch — only fields you pass are changed. Does not touch canonical fields. NOTE: array fields like highlights/readLog are REPLACED if the caller passes them; append-only helper ops (article.add_highlight, article.log_read) come later. Today, callers wanting to append must read the current overlay, push the new entry, and pass the full array back.

REST · PATCH /articles/:articleId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "articleId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "articleId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "article"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "archivedUrl": {
          "type": "string",
          "format": "uri"
        },
        "headline": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "articleSection": {
          "type": "string"
        },
        "publication": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "excerpt": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "wordCount": {
          "type": "integer"
        },
        "readingTimeMinutes": {
          "type": "number"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "placesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "peopleReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "entitiesReferenced": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/authors/items"
          },
          "default": []
        },
        "type": {
          "type": "string",
          "enum": [
            "news",
            "analysis",
            "opinion",
            "feature",
            "interview",
            "essay",
            "blog-post",
            "newsletter",
            "press-release",
            "other"
          ]
        }
      },
      "required": [
        "title",
        "url"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "queue": {
          "type": "string",
          "enum": [
            "to-read",
            "reading",
            "read",
            "skipped"
          ]
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "durationMinutes": {
                "type": "number"
              },
              "context": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "citedIn": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.book

book.add

scope · author effect · write audited v1

Add a book by providing canonical fields directly.

Primary write path for books. The caller provides canonical fields (title, authors, optional ISBN, optional publisher); the system handles ID generation, provenance, and storage. Soft ISBN-13 dedup: when `canonical.isbn` is set and a book with the same ISBN already exists, returns that row with `created: false` rather than inserting a duplicate. Books without ISBN (older works, audiobooks, manuscripts) skip the dedup and always insert — see the partial UNIQUE in drizzle/0006_books.sql. Provenance override: if the caller passes a `provenance` partial, its fields shallow-merge OVER the default `{source: mcp:<client>, schemaVersion: book@v1}`. Used by book.ingest_from_url.

REST · POST /books
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedYear": {
          "type": "integer"
        },
        "publishedDate": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "isbn10": {
          "type": "string"
        },
        "oclc": {
          "type": "string"
        },
        "pageCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "series": {
          "type": "string"
        },
        "seriesPosition": {
          "type": "number"
        },
        "edition": {
          "type": "string"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "coverUrl": {
          "type": "string",
          "format": "uri"
        },
        "derivedFrom": {
          "type": "string"
        },
        "originalLanguage": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "book": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "book"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "publisher": {
              "$ref": "#/properties/book/properties/canonical/properties/authors/items"
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "isbn": {
              "type": "string"
            },
            "isbn10": {
              "type": "string"
            },
            "oclc": {
              "type": "string"
            },
            "pageCount": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "series": {
              "type": "string"
            },
            "seriesPosition": {
              "type": "number"
            },
            "edition": {
              "type": "string"
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "coverUrl": {
              "type": "string",
              "format": "uri"
            },
            "derivedFrom": {
              "type": "string"
            },
            "originalLanguage": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "reading",
                "read",
                "paused",
                "dnf",
                "reference",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "shelf": {
              "type": "string"
            },
            "acquiredAt": {
              "type": "string",
              "format": "date"
            },
            "acquiredFrom": {
              "type": "string"
            },
            "loanedTo": {
              "type": "string"
            },
            "readLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "print-hardcover",
                      "print-paperback",
                      "ebook",
                      "audio",
                      "pdf",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "finished": {
                    "type": "boolean",
                    "default": true
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "highlights": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "text",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "book",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.get

scope · reader effect · read v1

Retrieve a full book by ID, including canonical and overlay.

REST · GET /books/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "book"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedYear": {
          "type": "integer"
        },
        "publishedDate": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "isbn10": {
          "type": "string"
        },
        "oclc": {
          "type": "string"
        },
        "pageCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "series": {
          "type": "string"
        },
        "seriesPosition": {
          "type": "number"
        },
        "edition": {
          "type": "string"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "coverUrl": {
          "type": "string",
          "format": "uri"
        },
        "derivedFrom": {
          "type": "string"
        },
        "originalLanguage": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.ingest_from_url

scope · author effect · write audited v1

Ingest a book from an OpenLibrary, Wikipedia, or Wikidata URL.

Two-tier ladder: OpenLibrary first (richest structured book metadata — ISBN-13, ISBN-10, publisher, page count, cover URL, subjects). Wikidata fallback for books only on Wikipedia. Both tiers populate the full canonical including sourceText (verbatim description). Accepts: - https://openlibrary.org/works/OL12345W/Foo - https://openlibrary.org/books/OL5847291M - https://en.wikipedia.org/wiki/Carnitas_(book) - https://www.wikidata.org/wiki/Q5301921 - Q5301921 (bare Q-id) - ISBN-13 (e.g. 9780062330147 — resolves via OpenLibrary)

REST · POST /books/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "book": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "book"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "publisher": {
              "$ref": "#/properties/book/properties/canonical/properties/authors/items"
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "isbn": {
              "type": "string"
            },
            "isbn10": {
              "type": "string"
            },
            "oclc": {
              "type": "string"
            },
            "pageCount": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "series": {
              "type": "string"
            },
            "seriesPosition": {
              "type": "number"
            },
            "edition": {
              "type": "string"
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "coverUrl": {
              "type": "string",
              "format": "uri"
            },
            "derivedFrom": {
              "type": "string"
            },
            "originalLanguage": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "reading",
                "read",
                "paused",
                "dnf",
                "reference",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "shelf": {
              "type": "string"
            },
            "acquiredAt": {
              "type": "string",
              "format": "date"
            },
            "acquiredFrom": {
              "type": "string"
            },
            "loanedTo": {
              "type": "string"
            },
            "readLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "print-hardcover",
                      "print-paperback",
                      "ebook",
                      "audio",
                      "pdf",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "finished": {
                    "type": "boolean",
                    "default": true
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "highlights": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "text",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "openlibrary",
            "wikidata",
            "cached"
          ]
        },
        "identifier": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "identifier",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "book",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.log_read

scope · author effect · write audited v1

Append a read-log entry to a book overlay.

Mirror of recipe.log_cook. Append-only; prior entries immutable. Updates overall rating to the mean of all per-read ratings when `updateOverallRating: true` is passed and the entry has a rating.

REST · POST /books/:bookId/reads
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "bookId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "format": {
          "type": "string",
          "enum": [
            "print-hardcover",
            "print-paperback",
            "ebook",
            "audio",
            "pdf",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "finished": {
          "type": "boolean",
          "default": true
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "bookId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "readLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "format": {
          "type": "string",
          "enum": [
            "print-hardcover",
            "print-paperback",
            "ebook",
            "audio",
            "pdf",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "finished": {
          "type": "boolean",
          "default": true
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "readLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.search

scope · reader effect · read v1

Search books by title (trigram), author, subject, series, or shelf.

Book search via SQL filters: trigram match on canonical.title (uses books_title_trgm GIN index with the % operator and similarity score), JSONB containment on subjects + tags, substring on author names, overlay.status / shelf / rating. Cursor pagination via composite (updated_at DESC, id DESC) index.

REST · GET /books/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "subject": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "author": {
      "type": "string"
    },
    "series": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "untried",
        "reading",
        "read",
        "paused",
        "dnf",
        "reference",
        "retired"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    },
    "shelf": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "publisher": {
            "type": "string"
          },
          "publishedYear": {
            "type": "integer"
          },
          "series": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "authors"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a book (admin-tier).

Whole-canonical replacement. The caller sends the complete BookCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected by this op. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency — pass the value you last saw, and the write is rejected with conflict if the row has moved since.

REST · PUT /books/:bookId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "bookId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedYear": {
          "type": "integer"
        },
        "publishedDate": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "isbn10": {
          "type": "string"
        },
        "oclc": {
          "type": "string"
        },
        "pageCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "series": {
          "type": "string"
        },
        "seriesPosition": {
          "type": "number"
        },
        "edition": {
          "type": "string"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "coverUrl": {
          "type": "string",
          "format": "uri"
        },
        "derivedFrom": {
          "type": "string"
        },
        "originalLanguage": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "bookId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "book"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedYear": {
          "type": "integer"
        },
        "publishedDate": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "isbn10": {
          "type": "string"
        },
        "oclc": {
          "type": "string"
        },
        "pageCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "series": {
          "type": "string"
        },
        "seriesPosition": {
          "type": "number"
        },
        "edition": {
          "type": "string"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "coverUrl": {
          "type": "string",
          "format": "uri"
        },
        "derivedFrom": {
          "type": "string"
        },
        "originalLanguage": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

book.update_overlay

scope · author effect · write audited v1

Update overlay fields on a book (status, rating, shelf, etc.).

Shallow-merge patch — only fields you pass are changed. Does not touch canonical fields. Array fields (readLog, highlights, pairsWith) are REPLACED if passed; append-only writes go through book.log_read and book.add_highlight (the latter deferred).

REST · PATCH /books/:bookId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "bookId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "bookId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "book"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "publishedYear": {
          "type": "integer"
        },
        "publishedDate": {
          "type": "string"
        },
        "isbn": {
          "type": "string"
        },
        "isbn10": {
          "type": "string"
        },
        "oclc": {
          "type": "string"
        },
        "pageCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "series": {
          "type": "string"
        },
        "seriesPosition": {
          "type": "number"
        },
        "edition": {
          "type": "string"
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "coverUrl": {
          "type": "string",
          "format": "uri"
        },
        "derivedFrom": {
          "type": "string"
        },
        "originalLanguage": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "reading",
            "read",
            "paused",
            "dnf",
            "reference",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "shelf": {
          "type": "string"
        },
        "acquiredAt": {
          "type": "string",
          "format": "date"
        },
        "acquiredFrom": {
          "type": "string"
        },
        "loanedTo": {
          "type": "string"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "print-hardcover",
                  "print-paperback",
                  "ebook",
                  "audio",
                  "pdf",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "finished": {
                "type": "boolean",
                "default": true
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.movie

movie.add

scope · author effect · write audited v1

Add a movie by providing canonical fields directly.

Primary write path. {movie, created} envelope (family-consistent). No automatic dedup — use movie.merge (deferred) to collapse duplicates. Optional provenance? override for ingest pre-processors.

REST · POST /movies
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "releaseYear": {
          "type": "integer"
        },
        "releaseDate": {
          "type": "string"
        },
        "directors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "runtimeMinutes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "watched",
            "rewatched",
            "wishlist",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "theater",
                  "streaming",
                  "physical",
                  "tv",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "movie": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "movie"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "originalTitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "releaseYear": {
              "type": "integer"
            },
            "releaseDate": {
              "type": "string"
            },
            "directors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "cast": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "productionCompanies": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "distributors": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "runtimeMinutes": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "country": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "originalLanguage": {
              "type": "string",
              "default": "en"
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "posterUrl": {
              "type": "string",
              "format": "uri"
            },
            "trailerUrl": {
              "type": "string",
              "format": "uri"
            },
            "partOfFranchise": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unwatched",
                "watching",
                "watched",
                "rewatched",
                "wishlist",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "watchLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "theater",
                      "streaming",
                      "physical",
                      "tv",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "movie",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.get

scope · reader effect · read v1

Retrieve a full movie by ID, including canonical and overlay.

REST · GET /movies/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "movie"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "releaseYear": {
          "type": "integer"
        },
        "releaseDate": {
          "type": "string"
        },
        "directors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "runtimeMinutes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "watched",
            "rewatched",
            "wishlist",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "theater",
                  "streaming",
                  "physical",
                  "tv",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.ingest_from_url

scope · author effect · write audited v1

Ingest a movie from a Wikipedia or Wikidata URL.

Wikidata-backed for now (Q11424 = film). Extracts name, aliases, description, releaseYear via P577 claim parse, directors via P57 claim (left as bare strings for now — Person resolution deferred). IMDB tt-id appended to sameAs when P345 is present on the Wikidata entity.

REST · POST /movies/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "movie": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "movie"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "originalTitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "releaseYear": {
              "type": "integer"
            },
            "releaseDate": {
              "type": "string"
            },
            "directors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "cast": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "productionCompanies": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "distributors": {
              "type": "array",
              "items": {
                "$ref": "#/properties/movie/properties/canonical/properties/directors/items"
              },
              "default": []
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "runtimeMinutes": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "country": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "originalLanguage": {
              "type": "string",
              "default": "en"
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "posterUrl": {
              "type": "string",
              "format": "uri"
            },
            "trailerUrl": {
              "type": "string",
              "format": "uri"
            },
            "partOfFranchise": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unwatched",
                "watching",
                "watched",
                "rewatched",
                "wishlist",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "watchLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "theater",
                      "streaming",
                      "physical",
                      "tv",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "movie",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.log_watch

scope · author effect · write audited v1

Append a watch-log entry to a movie overlay.

Append-only. Updates overall rating to mean of per-watch ratings when updateOverallRating=true.

REST · POST /movies/:movieId/watches
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "movieId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "format": {
          "type": "string",
          "enum": [
            "theater",
            "streaming",
            "physical",
            "tv",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "movieId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "watchLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "format": {
          "type": "string",
          "enum": [
            "theater",
            "streaming",
            "physical",
            "tv",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "watchLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.search

scope · reader effect · read v1

Search movies by title (trigram), director, year, genre, status.

Trigram match on canonical.title (movies_title_trgm GIN index). Filters by director substring, exact year or year-range, genre containment, watch status. Cursor pagination.

REST · GET /movies/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "genre": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "director": {
      "type": "string"
    },
    "year": {
      "type": "integer"
    },
    "yearAfter": {
      "type": "integer"
    },
    "yearBefore": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "enum": [
        "unwatched",
        "watching",
        "watched",
        "rewatched",
        "wishlist",
        "retired"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "directors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "releaseYear": {
            "type": "integer"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "runtimeMinutes": {
            "type": "integer"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "directors",
          "genres"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a movie (admin-tier).

Whole-canonical replacement. The caller sends the complete MovieCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /movies/:movieId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "movieId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "releaseYear": {
          "type": "integer"
        },
        "releaseDate": {
          "type": "string"
        },
        "directors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "runtimeMinutes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "movieId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "movie"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "releaseYear": {
          "type": "integer"
        },
        "releaseDate": {
          "type": "string"
        },
        "directors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "runtimeMinutes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "watched",
            "rewatched",
            "wishlist",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "theater",
                  "streaming",
                  "physical",
                  "tv",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

movie.update_overlay

scope · author effect · write audited v1

Update overlay fields on a movie (status, rating, watchLog, etc.).

REST · PATCH /movies/:movieId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "movieId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "watched",
            "rewatched",
            "wishlist",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "theater",
                  "streaming",
                  "physical",
                  "tv",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "movieId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "movie"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "releaseYear": {
          "type": "integer"
        },
        "releaseDate": {
          "type": "string"
        },
        "directors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "distributors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/directors/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "runtimeMinutes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "watched",
            "rewatched",
            "wishlist",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "format": {
                "type": "string",
                "enum": [
                  "theater",
                  "streaming",
                  "physical",
                  "tv",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.tv_series

tv_series.add

scope · author effect · write audited v1

Add a TV series by providing canonical fields directly.

Primary write path. {tv_series, created} envelope — the envelope key matches the type literal for cross-family consistency (multi-word types stay in snake_case). No automatic dedup; use tv_series.merge (deferred) to collapse duplicates.

REST · POST /tv-series
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "scripted",
            "limited-series",
            "documentary",
            "reality",
            "talk-show",
            "sketch",
            "anthology",
            "animated",
            "other"
          ],
          "default": "scripted"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "numberOfSeasons": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "numberOfEpisodes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "status": {
          "type": "string",
          "enum": [
            "ongoing",
            "ended",
            "cancelled",
            "hiatus",
            "announced"
          ]
        },
        "creators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "networks": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist",
            "rewatch"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "season": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episode": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episodeTitle": {
                "type": "string"
              },
              "format": {
                "type": "string",
                "enum": [
                  "live",
                  "streaming",
                  "physical",
                  "theater",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "currentSeason": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "currentEpisode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastWatchedAt": {
          "type": "string",
          "format": "date"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "tv_series": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "tv_series"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "originalTitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "scripted",
                "limited-series",
                "documentary",
                "reality",
                "talk-show",
                "sketch",
                "anthology",
                "animated",
                "other"
              ],
              "default": "scripted"
            },
            "startYear": {
              "type": "integer"
            },
            "endYear": {
              "type": "integer"
            },
            "startDate": {
              "type": "string"
            },
            "endDate": {
              "type": "string"
            },
            "numberOfSeasons": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "numberOfEpisodes": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "status": {
              "type": "string",
              "enum": [
                "ongoing",
                "ended",
                "cancelled",
                "hiatus",
                "announced"
              ]
            },
            "creators": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "cast": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "productionCompanies": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "networks": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "country": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "originalLanguage": {
              "type": "string",
              "default": "en"
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "posterUrl": {
              "type": "string",
              "format": "uri"
            },
            "trailerUrl": {
              "type": "string",
              "format": "uri"
            },
            "partOfFranchise": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unwatched",
                "watching",
                "caught-up",
                "completed",
                "paused",
                "dropped",
                "wishlist",
                "rewatch"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "watchLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "season": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "episode": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "episodeTitle": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "live",
                      "streaming",
                      "physical",
                      "theater",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "currentSeason": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "currentEpisode": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "lastWatchedAt": {
              "type": "string",
              "format": "date"
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "tv_series",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

tv_series.get

scope · reader effect · read v1

Retrieve a full TV series by ID, including canonical and overlay.

REST · GET /tv-series/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "tv_series"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "scripted",
            "limited-series",
            "documentary",
            "reality",
            "talk-show",
            "sketch",
            "anthology",
            "animated",
            "other"
          ],
          "default": "scripted"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "numberOfSeasons": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "numberOfEpisodes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "status": {
          "type": "string",
          "enum": [
            "ongoing",
            "ended",
            "cancelled",
            "hiatus",
            "announced"
          ]
        },
        "creators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "networks": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist",
            "rewatch"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "season": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episode": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episodeTitle": {
                "type": "string"
              },
              "format": {
                "type": "string",
                "enum": [
                  "live",
                  "streaming",
                  "physical",
                  "theater",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "currentSeason": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "currentEpisode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastWatchedAt": {
          "type": "string",
          "format": "date"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

tv_series.ingest_from_url

scope · author effect · write audited v1

Ingest a TV series from a Wikipedia or Wikidata URL.

Wikidata-backed (Q5398426 = TV series + sibling Q-ids). Parses P31 instance-of for kind detection, P580/P582 start/end times, P162 creators, P437 networks. Wikidata is the canonical source; TMDB / IMDB enrichment is a Phase A1 follow-up requiring API keys.

REST · POST /tv-series/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "tv_series": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "tv_series"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "originalTitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "scripted",
                "limited-series",
                "documentary",
                "reality",
                "talk-show",
                "sketch",
                "anthology",
                "animated",
                "other"
              ],
              "default": "scripted"
            },
            "startYear": {
              "type": "integer"
            },
            "endYear": {
              "type": "integer"
            },
            "startDate": {
              "type": "string"
            },
            "endDate": {
              "type": "string"
            },
            "numberOfSeasons": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "numberOfEpisodes": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "status": {
              "type": "string",
              "enum": [
                "ongoing",
                "ended",
                "cancelled",
                "hiatus",
                "announced"
              ]
            },
            "creators": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "cast": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "productionCompanies": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "networks": {
              "type": "array",
              "items": {
                "$ref": "#/properties/tv_series/properties/canonical/properties/creators/items"
              },
              "default": []
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "country": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "originalLanguage": {
              "type": "string",
              "default": "en"
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "posterUrl": {
              "type": "string",
              "format": "uri"
            },
            "trailerUrl": {
              "type": "string",
              "format": "uri"
            },
            "partOfFranchise": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unwatched",
                "watching",
                "caught-up",
                "completed",
                "paused",
                "dropped",
                "wishlist",
                "rewatch"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "watchLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "season": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "episode": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "episodeTitle": {
                    "type": "string"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "live",
                      "streaming",
                      "physical",
                      "theater",
                      "other"
                    ]
                  },
                  "context": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "currentSeason": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "currentEpisode": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "lastWatchedAt": {
              "type": "string",
              "format": "date"
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "tv_series",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

tv_series.log_watch

scope · author effect · write audited v1

Append an episode-watch entry to a TV series overlay.

Append-only. Updates currentSeason/Episode + lastWatchedAt to the new entry. Updates rating to mean of per-episode ratings when updateOverallRating=true.

REST · POST /tv-series/:tvSeriesId/watches
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "tvSeriesId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "season": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "episode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "episodeTitle": {
          "type": "string"
        },
        "format": {
          "type": "string",
          "enum": [
            "live",
            "streaming",
            "physical",
            "theater",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "tvSeriesId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "watchLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "season": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "episode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "episodeTitle": {
          "type": "string"
        },
        "format": {
          "type": "string",
          "enum": [
            "live",
            "streaming",
            "physical",
            "theater",
            "other"
          ]
        },
        "context": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "watchLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

tv_series.search

scope · reader effect · read v1

Search TV series by title (trigram), kind, creator, network, year, genre, status.

Trigram match on canonical.title (tv_series_title_trgm GIN index). Filters by series kind, year range, genre containment, creator/network substrings, watch status, rating. Cursor pagination.

REST · GET /tv-series/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "scripted",
        "limited-series",
        "documentary",
        "reality",
        "talk-show",
        "sketch",
        "anthology",
        "animated",
        "other"
      ]
    },
    "genre": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "creator": {
      "type": "string"
    },
    "network": {
      "type": "string"
    },
    "yearAfter": {
      "type": "integer"
    },
    "yearBefore": {
      "type": "integer"
    },
    "status": {
      "type": "string",
      "enum": [
        "unwatched",
        "watching",
        "caught-up",
        "completed",
        "paused",
        "dropped",
        "wishlist",
        "rewatch"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "startYear": {
            "type": "integer"
          },
          "endYear": {
            "type": "integer"
          },
          "numberOfSeasons": {
            "type": "integer"
          },
          "numberOfEpisodes": {
            "type": "integer"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "kind",
          "genres",
          "networks"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

tv_series.update_overlay

scope · author effect · write audited v1

Update overlay fields on a TV series (status, currentSeason/Episode, watchLog, rating).

REST · PATCH /tv-series/:tvSeriesId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "tvSeriesId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist",
            "rewatch"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "season": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episode": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episodeTitle": {
                "type": "string"
              },
              "format": {
                "type": "string",
                "enum": [
                  "live",
                  "streaming",
                  "physical",
                  "theater",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "currentSeason": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "currentEpisode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastWatchedAt": {
          "type": "string",
          "format": "date"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "tvSeriesId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "tv_series"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "originalTitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "scripted",
            "limited-series",
            "documentary",
            "reality",
            "talk-show",
            "sketch",
            "anthology",
            "animated",
            "other"
          ],
          "default": "scripted"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "startDate": {
          "type": "string"
        },
        "endDate": {
          "type": "string"
        },
        "numberOfSeasons": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "numberOfEpisodes": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "status": {
          "type": "string",
          "enum": [
            "ongoing",
            "ended",
            "cancelled",
            "hiatus",
            "announced"
          ]
        },
        "creators": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "cast": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "productionCompanies": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "networks": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/creators/items"
          },
          "default": []
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "country": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "originalLanguage": {
          "type": "string",
          "default": "en"
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "posterUrl": {
          "type": "string",
          "format": "uri"
        },
        "trailerUrl": {
          "type": "string",
          "format": "uri"
        },
        "partOfFranchise": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unwatched",
            "watching",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist",
            "rewatch"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "season": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episode": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "episodeTitle": {
                "type": "string"
              },
              "format": {
                "type": "string",
                "enum": [
                  "live",
                  "streaming",
                  "physical",
                  "theater",
                  "other"
                ]
              },
              "context": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "currentSeason": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "currentEpisode": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastWatchedAt": {
          "type": "string",
          "format": "date"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.podcast

podcast.add

scope · author effect · write audited v1

Add a podcast by providing canonical fields directly.

Primary write path. {podcast, created} envelope (family-consistent). No automatic dedup; use podcast.merge (deferred) to collapse duplicates.

REST · POST /podcasts
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "interview",
            "narrative",
            "news",
            "comedy",
            "true-crime",
            "panel",
            "monologue",
            "review",
            "educational",
            "business",
            "other"
          ]
        },
        "hosts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/hosts/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "feedUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "episodeCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "hiatus": {
          "type": "boolean"
        },
        "explicit": {
          "type": "boolean"
        },
        "partOfNetwork": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unsubscribed",
            "subscribed",
            "listening",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "episodeTitle": {
                "type": "string"
              },
              "episodeNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "seasonNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "durationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "totalDurationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "context": {
                "type": "string"
              },
              "app": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "finished": {
                "type": "boolean",
                "default": true
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lastListenedAt": {
          "type": "string",
          "format": "date"
        },
        "lastEpisodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastEpisodeTitle": {
          "type": "string"
        },
        "listenSpeed": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "notificationApp": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "podcast": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "podcast"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "interview",
                "narrative",
                "news",
                "comedy",
                "true-crime",
                "panel",
                "monologue",
                "review",
                "educational",
                "business",
                "other"
              ]
            },
            "hosts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "publisher": {
              "$ref": "#/properties/podcast/properties/canonical/properties/hosts/items"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "feedUrl": {
              "type": "string",
              "format": "uri"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "startYear": {
              "type": "integer"
            },
            "endYear": {
              "type": "integer"
            },
            "episodeCount": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "hiatus": {
              "type": "boolean"
            },
            "explicit": {
              "type": "boolean"
            },
            "partOfNetwork": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unsubscribed",
                "subscribed",
                "listening",
                "caught-up",
                "completed",
                "paused",
                "dropped",
                "wishlist"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "listenLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "episodeTitle": {
                    "type": "string"
                  },
                  "episodeNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "seasonNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "durationMinutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "totalDurationMinutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "context": {
                    "type": "string"
                  },
                  "app": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "finished": {
                    "type": "boolean",
                    "default": true
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "lastListenedAt": {
              "type": "string",
              "format": "date"
            },
            "lastEpisodeNumber": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "lastEpisodeTitle": {
              "type": "string"
            },
            "listenSpeed": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "notificationApp": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "podcast",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

podcast.get

scope · reader effect · read v1

Retrieve a full podcast by ID, including canonical and overlay.

REST · GET /podcasts/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "podcast"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "interview",
            "narrative",
            "news",
            "comedy",
            "true-crime",
            "panel",
            "monologue",
            "review",
            "educational",
            "business",
            "other"
          ]
        },
        "hosts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/hosts/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "feedUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "episodeCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "hiatus": {
          "type": "boolean"
        },
        "explicit": {
          "type": "boolean"
        },
        "partOfNetwork": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unsubscribed",
            "subscribed",
            "listening",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "episodeTitle": {
                "type": "string"
              },
              "episodeNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "seasonNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "durationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "totalDurationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "context": {
                "type": "string"
              },
              "app": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "finished": {
                "type": "boolean",
                "default": true
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lastListenedAt": {
          "type": "string",
          "format": "date"
        },
        "lastEpisodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastEpisodeTitle": {
          "type": "string"
        },
        "listenSpeed": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "notificationApp": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

podcast.ingest_from_url

scope · author effect · write audited v1

Ingest a podcast from an Apple Podcasts URL, iTunes id, or Wikidata URL.

Primary source: Apple Podcasts URL or bare iTunes id (free Lookup API, no auth) — returns title, hosts (artistName), artwork, feedUrl, country, primaryGenre, releaseDate, trackCount. Fallback: Wikidata URL — uses P5842 (Apple Podcasts id) to call the same Lookup API if present, else baseline-en labels only.

REST · POST /podcasts/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "podcast": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "podcast"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "interview",
                "narrative",
                "news",
                "comedy",
                "true-crime",
                "panel",
                "monologue",
                "review",
                "educational",
                "business",
                "other"
              ]
            },
            "hosts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "publisher": {
              "$ref": "#/properties/podcast/properties/canonical/properties/hosts/items"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "feedUrl": {
              "type": "string",
              "format": "uri"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "genres": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "subjects": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "startYear": {
              "type": "integer"
            },
            "endYear": {
              "type": "integer"
            },
            "episodeCount": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "hiatus": {
              "type": "boolean"
            },
            "explicit": {
              "type": "boolean"
            },
            "partOfNetwork": {
              "type": "string"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "unsubscribed",
                "subscribed",
                "listening",
                "caught-up",
                "completed",
                "paused",
                "dropped",
                "wishlist"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "listenLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "episodeTitle": {
                    "type": "string"
                  },
                  "episodeNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "seasonNumber": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "durationMinutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "totalDurationMinutes": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "context": {
                    "type": "string"
                  },
                  "app": {
                    "type": "string"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "finished": {
                    "type": "boolean",
                    "default": true
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "lastListenedAt": {
              "type": "string",
              "format": "date"
            },
            "lastEpisodeNumber": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "lastEpisodeTitle": {
              "type": "string"
            },
            "listenSpeed": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "notificationApp": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "pairsWith": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "itunes",
            "wikidata",
            "cached"
          ]
        },
        "itunesId": {
          "type": "integer"
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "podcast",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

podcast.log_listen

scope · author effect · write audited v1

Append an episode-listen entry to a podcast overlay.

Append-only. Updates lastListenedAt + lastEpisode* pointers to the new entry. Updates rating to mean of per-episode ratings when updateOverallRating=true.

REST · POST /podcasts/:podcastId/listens
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "podcastId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "episodeTitle": {
          "type": "string"
        },
        "episodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "seasonNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "durationMinutes": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "totalDurationMinutes": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "context": {
          "type": "string"
        },
        "app": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "finished": {
          "type": "boolean",
          "default": true
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "podcastId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "listenLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "episodeTitle": {
          "type": "string"
        },
        "episodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "seasonNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "durationMinutes": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "totalDurationMinutes": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "context": {
          "type": "string"
        },
        "app": {
          "type": "string"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "finished": {
          "type": "boolean",
          "default": true
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "listenLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

podcast.search

scope · reader effect · read v1

Search podcasts by title (trigram), host, publisher, genre, status.

Trigram match on canonical.title (podcasts_title_trgm GIN index). Filters by kind, host/publisher substrings, genre + subject containment, listen status, rating.

REST · GET /podcasts/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "interview",
        "narrative",
        "news",
        "comedy",
        "true-crime",
        "panel",
        "monologue",
        "review",
        "educational",
        "business",
        "other"
      ]
    },
    "host": {
      "type": "string"
    },
    "publisher": {
      "type": "string"
    },
    "genre": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "subject": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "status": {
      "type": "string",
      "enum": [
        "unsubscribed",
        "subscribed",
        "listening",
        "caught-up",
        "completed",
        "paused",
        "dropped",
        "wishlist"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "publisher": {
            "type": "string"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "episodeCount": {
            "type": "integer"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "hosts",
          "genres"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

podcast.update_overlay

scope · author effect · write audited v1

Update overlay fields on a podcast (subscription status, listenLog, rating, listenSpeed).

REST · PATCH /podcasts/:podcastId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "podcastId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unsubscribed",
            "subscribed",
            "listening",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "episodeTitle": {
                "type": "string"
              },
              "episodeNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "seasonNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "durationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "totalDurationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "context": {
                "type": "string"
              },
              "app": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "finished": {
                "type": "boolean",
                "default": true
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lastListenedAt": {
          "type": "string",
          "format": "date"
        },
        "lastEpisodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastEpisodeTitle": {
          "type": "string"
        },
        "listenSpeed": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "notificationApp": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "podcastId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "podcast"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "interview",
            "narrative",
            "news",
            "comedy",
            "true-crime",
            "panel",
            "monologue",
            "review",
            "educational",
            "business",
            "other"
          ]
        },
        "hosts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/hosts/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "feedUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "genres": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "subjects": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "startYear": {
          "type": "integer"
        },
        "endYear": {
          "type": "integer"
        },
        "episodeCount": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "hiatus": {
          "type": "boolean"
        },
        "explicit": {
          "type": "boolean"
        },
        "partOfNetwork": {
          "type": "string"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "unsubscribed",
            "subscribed",
            "listening",
            "caught-up",
            "completed",
            "paused",
            "dropped",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "episodeTitle": {
                "type": "string"
              },
              "episodeNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "seasonNumber": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "durationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "totalDurationMinutes": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "context": {
                "type": "string"
              },
              "app": {
                "type": "string"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "finished": {
                "type": "boolean",
                "default": true
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lastListenedAt": {
          "type": "string",
          "format": "date"
        },
        "lastEpisodeNumber": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "lastEpisodeTitle": {
          "type": "string"
        },
        "listenSpeed": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "notificationApp": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "pairsWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.video

video.add

scope · author effect · write audited v1

Add a video by providing canonical fields directly.

Primary write path. {video, created} envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (the transcript pipeline, when built).

REST · POST /videos
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "creator": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/creator/items"
        },
        "uploadDate": {
          "type": "string",
          "format": "date"
        },
        "duration": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string",
          "format": "uri"
        },
        "embedUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "platform": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "video": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "video"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "creator": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "publisher": {
              "$ref": "#/properties/video/properties/canonical/properties/creator/items"
            },
            "uploadDate": {
              "type": "string",
              "format": "date"
            },
            "duration": {
              "type": "string"
            },
            "contentUrl": {
              "type": "string",
              "format": "uri"
            },
            "embedUrl": {
              "type": "string",
              "format": "uri"
            },
            "thumbnailUrl": {
              "type": "string",
              "format": "uri"
            },
            "genre": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "platform": {
              "type": "string"
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "watchLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "summary": {
              "type": "string"
            },
            "recommendedBy": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "video",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

video.get

scope · reader effect · read v1

Retrieve a full video by ID, including canonical and overlay.

REST · GET /videos/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "video"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "creator": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/creator/items"
        },
        "uploadDate": {
          "type": "string",
          "format": "date"
        },
        "duration": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string",
          "format": "uri"
        },
        "embedUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "platform": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

video.log_watch

scope · author effect · write audited v1

Append a watch-log entry to a video overlay.

Append-only. Updates overall rating to mean of per-watch ratings when updateOverallRating=true.

REST · POST /videos/:videoId/watches
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "videoId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "videoId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "watchLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "watchLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

video.search

scope · reader effect · read v1

Search videos by title (trigram), creator, publisher, platform, genre, status.

Trigram match on canonical.title (videos_title_trgm GIN index). Filters by creator substring, publisher substring, platform exact, genre containment, watch status. Cursor pagination.

REST · GET /videos/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "genre": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "creator": {
      "type": "string"
    },
    "publisher": {
      "type": "string"
    },
    "platform": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "untried",
        "tried",
        "regular",
        "retired"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "creators": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "publisher": {
            "type": "string"
          },
          "uploadDate": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "creators",
          "genres"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

video.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a video (admin-tier).

Whole-canonical replacement. The caller sends the complete VideoCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /videos/:videoId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "videoId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "creator": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/creator/items"
        },
        "uploadDate": {
          "type": "string",
          "format": "date"
        },
        "duration": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string",
          "format": "uri"
        },
        "embedUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "platform": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "videoId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "video"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "creator": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/creator/items"
        },
        "uploadDate": {
          "type": "string",
          "format": "date"
        },
        "duration": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string",
          "format": "uri"
        },
        "embedUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "platform": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

video.update_overlay

scope · author effect · write audited v1

Update overlay fields on a video (status, rating, watchLog, etc.).

REST · PATCH /videos/:videoId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "videoId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "videoId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "video"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "creator": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/creator/items"
        },
        "uploadDate": {
          "type": "string",
          "format": "date"
        },
        "duration": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string",
          "format": "uri"
        },
        "embedUrl": {
          "type": "string",
          "format": "uri"
        },
        "thumbnailUrl": {
          "type": "string",
          "format": "uri"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "platform": {
          "type": "string"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "watchLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        },
        "recommendedBy": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.research_report

research_report.add

scope · author effect · write audited v1

Add a research report by providing canonical fields directly.

Primary write path. { research_report, created } envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (when built).

REST · POST /research-reports
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "institution": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "abstract": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "doi": {
          "type": "string"
        },
        "reportNumber": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "research_report": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "research_report"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            },
            "subtitle": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "authors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "language": {
              "type": "string",
              "default": "en"
            },
            "publisher": {
              "$ref": "#/properties/research_report/properties/canonical/properties/authors/items"
            },
            "institution": {
              "type": "string"
            },
            "datePublished": {
              "type": "string",
              "format": "date"
            },
            "abstract": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "doi": {
              "type": "string"
            },
            "reportNumber": {
              "type": "string"
            },
            "fullText": {
              "type": "string"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "title"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "readLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "highlights": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  },
                  "position": {
                    "type": "number"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "text",
                  "createdAt"
                ],
                "additionalProperties": false
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "research_report",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

research_report.get

scope · reader effect · read v1

Retrieve a full research report by ID, including canonical and overlay.

REST · GET /research-reports/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "research_report"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "institution": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "abstract": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "doi": {
          "type": "string"
        },
        "reportNumber": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

research_report.log_read

scope · author effect · write audited v1

Append a read-log entry to a research report overlay.

Mirror of book.log_read. Append-only; prior entries immutable. Records the date you read it and optional takeaway notes.

REST · POST /research-reports/:researchReportId/reads
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "researchReportId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "researchReportId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "readLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "readLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

research_report.search

scope · reader effect · read v1

Search research reports by title (trigram), author, publisher, institution, status.

Trigram match on canonical.title (research_reports_title_trgm GIN index). Filters by author substring, publisher substring, institution substring, overlay status, and minimum rating. Cursor pagination via the composite (updated_at DESC, id DESC) index.

REST · GET /research-reports/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "author": {
      "type": "string"
    },
    "publisher": {
      "type": "string"
    },
    "institution": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "untried",
        "tried",
        "regular",
        "retired"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "publisher": {
            "type": "string"
          },
          "institution": {
            "type": "string"
          },
          "datePublished": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "title",
          "authors"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

research_report.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a research report (admin-tier).

Whole-canonical replacement. The caller sends the complete ResearchReportCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /research-reports/:researchReportId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "researchReportId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "institution": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "abstract": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "doi": {
          "type": "string"
        },
        "reportNumber": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "researchReportId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "research_report"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "institution": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "abstract": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "doi": {
          "type": "string"
        },
        "reportNumber": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

research_report.update_overlay

scope · author effect · write audited v1

Update overlay fields on a research report (status, rating, notes, etc.).

Shallow-merge patch — only fields you pass are changed. Does not touch canonical. Array fields (readLog, highlights) are REPLACED if passed; append-only writes go through research_report.log_read.

REST · PATCH /research-reports/:researchReportId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "researchReportId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "researchReportId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "research_report"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "subtitle": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "authors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "language": {
          "type": "string",
          "default": "en"
        },
        "publisher": {
          "$ref": "#/properties/canonical/properties/authors/items"
        },
        "institution": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "abstract": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "doi": {
          "type": "string"
        },
        "reportNumber": {
          "type": "string"
        },
        "fullText": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "readLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "highlights": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "position": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "text",
              "createdAt"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.music

music.add

scope · author effect · write audited v1

Add a music record by providing canonical fields directly.

Primary write path. {music, created} envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (when built).

REST · POST /music
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "byArtist": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "inAlbum": {
          "type": "string"
        },
        "label": {
          "$ref": "#/properties/canonical/properties/byArtist/items"
        },
        "kind": {
          "type": "string",
          "enum": [
            "recording",
            "album",
            "single",
            "ep"
          ]
        },
        "duration": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "isrc": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "music": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "music"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "byArtist": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "inAlbum": {
              "type": "string"
            },
            "label": {
              "$ref": "#/properties/music/properties/canonical/properties/byArtist/items"
            },
            "kind": {
              "type": "string",
              "enum": [
                "recording",
                "album",
                "single",
                "ep"
              ]
            },
            "duration": {
              "type": "string"
            },
            "datePublished": {
              "type": "string",
              "format": "date"
            },
            "genre": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "isrc": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "listenLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "music",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music.get

scope · reader effect · read v1

Retrieve a full music record by ID, including canonical and overlay.

REST · GET /music/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "byArtist": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "inAlbum": {
          "type": "string"
        },
        "label": {
          "$ref": "#/properties/canonical/properties/byArtist/items"
        },
        "kind": {
          "type": "string",
          "enum": [
            "recording",
            "album",
            "single",
            "ep"
          ]
        },
        "duration": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "isrc": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music.log_listen

scope · author effect · write audited v1

Append a listen-log entry to a music overlay.

Append-only listen history. Records date and optional notes.

REST · POST /music/:musicId/listens
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "musicId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "musicId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "listenLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "listenLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music.search

scope · reader effect · read v1

Search music by name (trigram), artist, label, genre, kind.

Trigram match on canonical.name (music_title_trgm GIN index). Filters by artist substring, label substring, genre containment, kind (recording/album/single/ep), rating. Cursor pagination.

REST · GET /music/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "genre": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "artist": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "recording",
        "album",
        "single",
        "ep"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "artists": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "inAlbum": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "datePublished": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "artists",
          "genres"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a music record (admin-tier).

Whole-canonical replacement. The caller sends the complete MusicCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /music/:musicId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "musicId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "byArtist": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "inAlbum": {
          "type": "string"
        },
        "label": {
          "$ref": "#/properties/canonical/properties/byArtist/items"
        },
        "kind": {
          "type": "string",
          "enum": [
            "recording",
            "album",
            "single",
            "ep"
          ]
        },
        "duration": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "isrc": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "musicId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "byArtist": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "inAlbum": {
          "type": "string"
        },
        "label": {
          "$ref": "#/properties/canonical/properties/byArtist/items"
        },
        "kind": {
          "type": "string",
          "enum": [
            "recording",
            "album",
            "single",
            "ep"
          ]
        },
        "duration": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "isrc": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music.update_overlay

scope · author effect · write audited v1

Update overlay fields on a music record (status, rating, listenLog, etc.).

REST · PATCH /music/:musicId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "musicId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "musicId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "byArtist": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "inAlbum": {
          "type": "string"
        },
        "label": {
          "$ref": "#/properties/canonical/properties/byArtist/items"
        },
        "kind": {
          "type": "string",
          "enum": [
            "recording",
            "album",
            "single",
            "ep"
          ]
        },
        "duration": {
          "type": "string"
        },
        "datePublished": {
          "type": "string",
          "format": "date"
        },
        "genre": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "isrc": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "listenLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.quote

quote.add

scope · author effect · write audited v1

Add a quote by providing canonical fields directly.

Primary write path. {quote, created} envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (when built).

REST · POST /quotes
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "author": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/author/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "context": {
          "type": "string"
        },
        "citation": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "quote": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "quote"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "author": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "source": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "book",
                    "website",
                    "magazine",
                    "video",
                    "podcast",
                    "personal",
                    "other"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "publisher": {
                  "anyOf": [
                    {
                      "$ref": "#/properties/quote/properties/canonical/properties/author/items"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "publishedYear": {
                  "type": "integer"
                },
                "publishedDate": {
                  "type": "string"
                },
                "pageNumber": {
                  "type": "integer"
                },
                "isbn": {
                  "type": "string"
                },
                "doi": {
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            },
            "context": {
              "type": "string"
            },
            "citation": {
              "type": "string"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "text"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "quote",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

quote.get

scope · reader effect · read v1

Retrieve a full quote record by ID, including canonical and overlay.

REST · GET /quotes/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "quote"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "author": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/author/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "context": {
          "type": "string"
        },
        "citation": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

quote.search

scope · reader effect · read v1

Search quotes by text (trigram), author, source, keywords.

Trigram match on canonical.text (quotes_text_trgm GIN index — the display field for a quote is the quotation text, not a title). Filters by author substring, source title substring, keyword containment, rating. Cursor pagination.

REST · GET /quotes/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "author": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "text",
          "authors"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

quote.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a quote (admin-tier).

Whole-canonical replacement. The caller sends the complete QuoteCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /quotes/:quoteId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "quoteId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "author": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/author/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "context": {
          "type": "string"
        },
        "citation": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "quoteId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "quote"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "author": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/author/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "context": {
          "type": "string"
        },
        "citation": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

quote.update_overlay

scope · author effect · write audited v1

Update overlay fields on a quote (status, rating, favorite, notes, etc.).

REST · PATCH /quotes/:quoteId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "quoteId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "quoteId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "quote"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "author": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "source": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "book",
                "website",
                "magazine",
                "video",
                "podcast",
                "personal",
                "other"
              ]
            },
            "title": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "publisher": {
              "anyOf": [
                {
                  "$ref": "#/properties/canonical/properties/author/items"
                },
                {
                  "type": "string"
                }
              ]
            },
            "publishedYear": {
              "type": "integer"
            },
            "publishedDate": {
              "type": "string"
            },
            "pageNumber": {
              "type": "integer"
            },
            "isbn": {
              "type": "string"
            },
            "doi": {
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "context": {
          "type": "string"
        },
        "citation": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.software_application

software_application.add

scope · author effect · write audited v1

Add a software application by providing canonical fields directly.

REST · POST /software-applications
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "applicationCategory": {
          "type": "string",
          "enum": [
            "productivity",
            "developer",
            "creative",
            "utility",
            "game",
            "media",
            "social",
            "finance",
            "security",
            "communication",
            "browser",
            "other"
          ]
        },
        "operatingSystem": {
          "type": "string",
          "enum": [
            "macOS",
            "iOS",
            "iPadOS",
            "watchOS",
            "tvOS",
            "Windows",
            "Linux",
            "Android",
            "Web",
            "multi"
          ]
        },
        "softwareVersion": {
          "type": "string"
        },
        "publisher": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "free",
            "paid",
            "subscription",
            "freemium",
            "open-source",
            "trialware"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "applicationCategory"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "evaluating",
            "installed",
            "used",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "installedSince": {
          "type": "string",
          "format": "date"
        },
        "lastUsed": {
          "type": "string",
          "format": "date"
        },
        "subscriptionMonthly": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "licenseKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "software_application": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "software_application"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "description": {
              "type": "string"
            },
            "applicationCategory": {
              "type": "string",
              "enum": [
                "productivity",
                "developer",
                "creative",
                "utility",
                "game",
                "media",
                "social",
                "finance",
                "security",
                "communication",
                "browser",
                "other"
              ]
            },
            "operatingSystem": {
              "type": "string",
              "enum": [
                "macOS",
                "iOS",
                "iPadOS",
                "watchOS",
                "tvOS",
                "Windows",
                "Linux",
                "Android",
                "Web",
                "multi"
              ]
            },
            "softwareVersion": {
              "type": "string"
            },
            "publisher": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "downloadUrl": {
              "type": "string",
              "format": "uri"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "pricingModel": {
              "type": "string",
              "enum": [
                "free",
                "paid",
                "subscription",
                "freemium",
                "open-source",
                "trialware"
              ]
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "applicationCategory"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "wishlist",
                "evaluating",
                "installed",
                "used",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "installedSince": {
              "type": "string",
              "format": "date"
            },
            "lastUsed": {
              "type": "string",
              "format": "date"
            },
            "subscriptionMonthly": {
              "type": "number"
            },
            "currency": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "licenseKey": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "software_application",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

software_application.get

scope · reader effect · read v1

Retrieve a full software application by ID.

REST · GET /software-applications/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "software_application"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "applicationCategory": {
          "type": "string",
          "enum": [
            "productivity",
            "developer",
            "creative",
            "utility",
            "game",
            "media",
            "social",
            "finance",
            "security",
            "communication",
            "browser",
            "other"
          ]
        },
        "operatingSystem": {
          "type": "string",
          "enum": [
            "macOS",
            "iOS",
            "iPadOS",
            "watchOS",
            "tvOS",
            "Windows",
            "Linux",
            "Android",
            "Web",
            "multi"
          ]
        },
        "softwareVersion": {
          "type": "string"
        },
        "publisher": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "free",
            "paid",
            "subscription",
            "freemium",
            "open-source",
            "trialware"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "applicationCategory"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "evaluating",
            "installed",
            "used",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "installedSince": {
          "type": "string",
          "format": "date"
        },
        "lastUsed": {
          "type": "string",
          "format": "date"
        },
        "subscriptionMonthly": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "licenseKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

software_application.search

scope · reader effect · read v1

Search software apps by name, category, OS, publisher, pricing, status.

Trigram match on canonical.name (software_applications_title_trgm GIN). Filters by applicationCategory, operatingSystem, pricingModel, publisher substring, overlay status. Cursor pagination.

REST · GET /software-applications/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "applicationCategory": {
      "type": "string",
      "enum": [
        "productivity",
        "developer",
        "creative",
        "utility",
        "game",
        "media",
        "social",
        "finance",
        "security",
        "communication",
        "browser",
        "other"
      ]
    },
    "operatingSystem": {
      "type": "string",
      "enum": [
        "macOS",
        "iOS",
        "iPadOS",
        "watchOS",
        "tvOS",
        "Windows",
        "Linux",
        "Android",
        "Web",
        "multi"
      ]
    },
    "pricingModel": {
      "type": "string",
      "enum": [
        "free",
        "paid",
        "subscription",
        "freemium",
        "open-source",
        "trialware"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "wishlist",
        "evaluating",
        "installed",
        "used",
        "retired"
      ]
    },
    "publisher": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "applicationCategory": {
            "type": "string"
          },
          "operatingSystem": {
            "type": "string"
          },
          "publisher": {
            "type": "string"
          },
          "pricingModel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

software_application.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a software application (admin-tier).

REST · PUT /software-applications/:softwareApplicationId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "softwareApplicationId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "applicationCategory": {
          "type": "string",
          "enum": [
            "productivity",
            "developer",
            "creative",
            "utility",
            "game",
            "media",
            "social",
            "finance",
            "security",
            "communication",
            "browser",
            "other"
          ]
        },
        "operatingSystem": {
          "type": "string",
          "enum": [
            "macOS",
            "iOS",
            "iPadOS",
            "watchOS",
            "tvOS",
            "Windows",
            "Linux",
            "Android",
            "Web",
            "multi"
          ]
        },
        "softwareVersion": {
          "type": "string"
        },
        "publisher": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "free",
            "paid",
            "subscription",
            "freemium",
            "open-source",
            "trialware"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "applicationCategory"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "softwareApplicationId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "software_application"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "applicationCategory": {
          "type": "string",
          "enum": [
            "productivity",
            "developer",
            "creative",
            "utility",
            "game",
            "media",
            "social",
            "finance",
            "security",
            "communication",
            "browser",
            "other"
          ]
        },
        "operatingSystem": {
          "type": "string",
          "enum": [
            "macOS",
            "iOS",
            "iPadOS",
            "watchOS",
            "tvOS",
            "Windows",
            "Linux",
            "Android",
            "Web",
            "multi"
          ]
        },
        "softwareVersion": {
          "type": "string"
        },
        "publisher": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "free",
            "paid",
            "subscription",
            "freemium",
            "open-source",
            "trialware"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "applicationCategory"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "evaluating",
            "installed",
            "used",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "installedSince": {
          "type": "string",
          "format": "date"
        },
        "lastUsed": {
          "type": "string",
          "format": "date"
        },
        "subscriptionMonthly": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "licenseKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

software_application.update_overlay

scope · author effect · write audited v1

Update overlay fields on a software application (status, ratings, install dates).

REST · PATCH /software-applications/:softwareApplicationId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "softwareApplicationId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "evaluating",
            "installed",
            "used",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "installedSince": {
          "type": "string",
          "format": "date"
        },
        "lastUsed": {
          "type": "string",
          "format": "date"
        },
        "subscriptionMonthly": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "licenseKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "softwareApplicationId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "software_application"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "applicationCategory": {
          "type": "string",
          "enum": [
            "productivity",
            "developer",
            "creative",
            "utility",
            "game",
            "media",
            "social",
            "finance",
            "security",
            "communication",
            "browser",
            "other"
          ]
        },
        "operatingSystem": {
          "type": "string",
          "enum": [
            "macOS",
            "iOS",
            "iPadOS",
            "watchOS",
            "tvOS",
            "Windows",
            "Linux",
            "Android",
            "Web",
            "multi"
          ]
        },
        "softwareVersion": {
          "type": "string"
        },
        "publisher": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "downloadUrl": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "free",
            "paid",
            "subscription",
            "freemium",
            "open-source",
            "trialware"
          ]
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "applicationCategory"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "evaluating",
            "installed",
            "used",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "installedSince": {
          "type": "string",
          "format": "date"
        },
        "lastUsed": {
          "type": "string",
          "format": "date"
        },
        "subscriptionMonthly": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "licenseKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Entities

Actors — who and what does things in the world.

.person

person.add

scope · author effect · write audited v1

Add a person by providing canonical fields directly.

Primary write path for people. Used both for active people (family, colleagues) and for reference stubs created lazily during content ingestion. The caller provides canonical fields; the system handles ID generation, provenance, and storage.

REST · POST /persons
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "born": {
          "type": "string"
        },
        "died": {
          "type": "string"
        },
        "nationality": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "professions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "affiliations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "bio": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "birthPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "deathPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "knowsAbout": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "lastInteraction": {
          "type": "string",
          "format": "date"
        },
        "contactInfo": {
          "type": "object",
          "properties": {
            "email": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email"
              }
            },
            "phone": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "handles": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "person": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "person"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "givenName": {
              "type": "string"
            },
            "familyName": {
              "type": "string"
            },
            "born": {
              "type": "string"
            },
            "died": {
              "type": "string"
            },
            "nationality": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "professions": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "affiliations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "bio": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "birthPlace": {
              "$ref": "#/properties/person/properties/canonical/properties/affiliations/items"
            },
            "deathPlace": {
              "$ref": "#/properties/person/properties/canonical/properties/affiliations/items"
            },
            "knowsAbout": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "relationship": {
              "type": "string"
            },
            "lastInteraction": {
              "type": "string",
              "format": "date"
            },
            "contactInfo": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "phone": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "handles": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "person",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

person.get

scope · reader effect · read v1

Retrieve a full person by ID, including canonical and overlay.

REST · GET /persons/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "person"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "born": {
          "type": "string"
        },
        "died": {
          "type": "string"
        },
        "nationality": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "professions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "affiliations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "bio": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "birthPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "deathPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "knowsAbout": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "lastInteraction": {
          "type": "string",
          "format": "date"
        },
        "contactInfo": {
          "type": "object",
          "properties": {
            "email": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email"
              }
            },
            "phone": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "handles": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

person.ingest_from_url

scope · author effect · write audited v1

Ingest a person from a Wikipedia or Wikidata URL via Wikidata API.

Pre-processor for adding people from Wikidata. Accepts a Wikipedia URL (resolves via the Action API to a Q-id), a Wikidata URL, or a bare Q-id. Fetches the Wikidata entity JSON, extracts name (en label), aliases (en alt-labels), and bio (en description), and inserts via `person.add`. The full Wikidata JSON is preserved in provenance.rawCapture per Principle #8. Soft dedup: NONE in Phase 1 — two ingests = two rows. Use `person.merge` (deferred to PRD Phase 2) to consolidate later. See lessons.md 2026-05-27 envelope-precedent entry for rationale.

REST · POST /persons/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Wikipedia URL, Wikidata URL, or bare Q-id (e.g. Q5301921)."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "person": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "person"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "givenName": {
              "type": "string"
            },
            "familyName": {
              "type": "string"
            },
            "born": {
              "type": "string"
            },
            "died": {
              "type": "string"
            },
            "nationality": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "professions": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "affiliations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "bio": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "birthPlace": {
              "$ref": "#/properties/person/properties/canonical/properties/affiliations/items"
            },
            "deathPlace": {
              "$ref": "#/properties/person/properties/canonical/properties/affiliations/items"
            },
            "knowsAbout": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "relationship": {
              "type": "string"
            },
            "lastInteraction": {
              "type": "string",
              "format": "date"
            },
            "contactInfo": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "phone": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "handles": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "person",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

person.search

scope · reader effect · read v1

Search persons by name (trigram), profession, or nationality.

Person search via SQL filters: trigram match on canonical.name (uses persons_name_trgm GIN index, % operator), JSONB containment on profession + nationality + tags. Trigram threshold defaults to pg_trgm 0.3. Results sorted by similarity DESC then updated_at DESC, id DESC. Use person.get for full details.

REST · GET /persons/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "profession": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "nationality": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "professions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "nationality": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "professions",
          "nationality"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

person.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a person (admin-tier).

Whole-canonical replacement. The caller sends the complete PersonCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency. Especially load-bearing for reference-tier people whose canonical name/bio is the only editable surface (no overlay).

REST · PUT /persons/:personId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "personId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "born": {
          "type": "string"
        },
        "died": {
          "type": "string"
        },
        "nationality": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "professions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "affiliations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "bio": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "birthPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "deathPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "knowsAbout": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "personId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "person"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "born": {
          "type": "string"
        },
        "died": {
          "type": "string"
        },
        "nationality": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "professions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "affiliations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "bio": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "birthPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "deathPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "knowsAbout": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "lastInteraction": {
          "type": "string",
          "format": "date"
        },
        "contactInfo": {
          "type": "object",
          "properties": {
            "email": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email"
              }
            },
            "phone": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "handles": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

person.update_overlay

scope · author effect · write audited v1

Update overlay fields on a person (relationship, contact info, etc.).

Partial update — only fields you pass are changed. Does not touch canonical fields. For tier=reference people becoming tier=active, add an overlay here.

REST · PATCH /persons/:personId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "personId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "lastInteraction": {
          "type": "string",
          "format": "date"
        },
        "contactInfo": {
          "type": "object",
          "properties": {
            "email": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email"
              }
            },
            "phone": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "handles": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "personId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "person"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "givenName": {
          "type": "string"
        },
        "familyName": {
          "type": "string"
        },
        "born": {
          "type": "string"
        },
        "died": {
          "type": "string"
        },
        "nationality": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "professions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "affiliations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "bio": {
          "type": "string"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "birthPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "deathPlace": {
          "$ref": "#/properties/canonical/properties/affiliations/items"
        },
        "knowsAbout": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "lastInteraction": {
          "type": "string",
          "format": "date"
        },
        "contactInfo": {
          "type": "object",
          "properties": {
            "email": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email"
              }
            },
            "phone": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "handles": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.organization

organization.add

scope · author effect · write audited v1

Add an organization by providing canonical fields directly.

Primary write path for organizations — publishers, magazines, studios, brands. Used both for active orgs (your LLC, partners) and for reference stubs created lazily during content ingestion. Envelope: {organization, created}. `created` is always true today (no soft dedup yet).

REST · POST /organizations
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "publisher",
            "magazine",
            "newspaper",
            "broadcaster",
            "studio",
            "label",
            "university",
            "government",
            "nonprofit",
            "brand",
            "other"
          ]
        },
        "founded": {
          "type": "string"
        },
        "dissolved": {
          "type": "string"
        },
        "headquartered": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "founders": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/headquartered/items"
          },
          "default": []
        },
        "parent": {
          "$ref": "#/properties/canonical/properties/headquartered/items"
        },
        "industry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "type": "string",
          "format": "uri"
        },
        "legalName": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "history": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "organization": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "organization"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "company",
                "publisher",
                "magazine",
                "newspaper",
                "broadcaster",
                "studio",
                "label",
                "university",
                "government",
                "nonprofit",
                "brand",
                "other"
              ]
            },
            "founded": {
              "type": "string"
            },
            "dissolved": {
              "type": "string"
            },
            "headquartered": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "founders": {
              "type": "array",
              "items": {
                "$ref": "#/properties/organization/properties/canonical/properties/headquartered/items"
              },
              "default": []
            },
            "parent": {
              "$ref": "#/properties/organization/properties/canonical/properties/headquartered/items"
            },
            "industry": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "description": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "logo": {
              "type": "string",
              "format": "uri"
            },
            "legalName": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "relationship": {
              "type": "string"
            },
            "history": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "organization",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

organization.get

scope · reader effect · read v1

Retrieve a full organization by ID, including canonical and overlay.

REST · GET /organizations/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "organization"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "publisher",
            "magazine",
            "newspaper",
            "broadcaster",
            "studio",
            "label",
            "university",
            "government",
            "nonprofit",
            "brand",
            "other"
          ]
        },
        "founded": {
          "type": "string"
        },
        "dissolved": {
          "type": "string"
        },
        "headquartered": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "founders": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/headquartered/items"
          },
          "default": []
        },
        "parent": {
          "$ref": "#/properties/canonical/properties/headquartered/items"
        },
        "industry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "type": "string",
          "format": "uri"
        },
        "legalName": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "history": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

organization.ingest_from_url

scope · author effect · write audited v1

Ingest an organization from a Wikipedia or Wikidata URL.

Pre-processor for adding organizations from Wikidata. Same shape as person.ingest_from_url. Maps to OrganizationCanonical: name, aliases, description. The `kind` field is best-effort from Wikidata's P31 instance-of claim — newspaper/publisher/company are detected; falls back to undefined.

REST · POST /organizations/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Wikipedia URL, Wikidata URL, or bare Q-id (e.g. Q5301921)."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "organization": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "organization"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "company",
                "publisher",
                "magazine",
                "newspaper",
                "broadcaster",
                "studio",
                "label",
                "university",
                "government",
                "nonprofit",
                "brand",
                "other"
              ]
            },
            "founded": {
              "type": "string"
            },
            "dissolved": {
              "type": "string"
            },
            "headquartered": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "founders": {
              "type": "array",
              "items": {
                "$ref": "#/properties/organization/properties/canonical/properties/headquartered/items"
              },
              "default": []
            },
            "parent": {
              "$ref": "#/properties/organization/properties/canonical/properties/headquartered/items"
            },
            "industry": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "description": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "logo": {
              "type": "string",
              "format": "uri"
            },
            "legalName": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "relationship": {
              "type": "string"
            },
            "history": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "organization",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

organization.search

scope · reader effect · read v1

Search organizations by name (trigram), kind, or industry.

Organization search via SQL filters: trigram match on canonical.name (uses organizations_name_trgm GIN index, % operator), JSONB containment on industry + tags, and equality on canonical.kind. Trigram threshold defaults to pg_trgm 0.3. Results sorted by similarity DESC then updated_at DESC, id DESC. Use organization.get for full details.

REST · GET /organizations/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "company",
        "publisher",
        "magazine",
        "newspaper",
        "broadcaster",
        "studio",
        "label",
        "university",
        "government",
        "nonprofit",
        "brand",
        "other"
      ]
    },
    "industry": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "industry": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "industry"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

organization.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on an organization (admin-tier).

Whole-canonical replacement. The caller sends the complete OrganizationCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency. Load-bearing for reference-tier organizations (the publisher created as a stub during book ingest, etc.).

REST · PUT /organizations/:organizationId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "organizationId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "publisher",
            "magazine",
            "newspaper",
            "broadcaster",
            "studio",
            "label",
            "university",
            "government",
            "nonprofit",
            "brand",
            "other"
          ]
        },
        "founded": {
          "type": "string"
        },
        "dissolved": {
          "type": "string"
        },
        "headquartered": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "founders": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/headquartered/items"
          },
          "default": []
        },
        "parent": {
          "$ref": "#/properties/canonical/properties/headquartered/items"
        },
        "industry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "type": "string",
          "format": "uri"
        },
        "legalName": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "organizationId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "organization"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "publisher",
            "magazine",
            "newspaper",
            "broadcaster",
            "studio",
            "label",
            "university",
            "government",
            "nonprofit",
            "brand",
            "other"
          ]
        },
        "founded": {
          "type": "string"
        },
        "dissolved": {
          "type": "string"
        },
        "headquartered": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "founders": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/headquartered/items"
          },
          "default": []
        },
        "parent": {
          "$ref": "#/properties/canonical/properties/headquartered/items"
        },
        "industry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "type": "string",
          "format": "uri"
        },
        "legalName": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "history": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

organization.update_overlay

scope · author effect · write audited v1

Update overlay fields on an organization (relationship, history, etc.).

Partial update — only fields you pass are changed. Does not touch canonical fields. For tier=reference orgs becoming tier=active, add an overlay here.

REST · PATCH /organizations/:organizationId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "organizationId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "history": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "organizationId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "organization"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "company",
            "publisher",
            "magazine",
            "newspaper",
            "broadcaster",
            "studio",
            "label",
            "university",
            "government",
            "nonprofit",
            "brand",
            "other"
          ]
        },
        "founded": {
          "type": "string"
        },
        "dissolved": {
          "type": "string"
        },
        "headquartered": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "founders": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/headquartered/items"
          },
          "default": []
        },
        "parent": {
          "$ref": "#/properties/canonical/properties/headquartered/items"
        },
        "industry": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "logo": {
          "type": "string",
          "format": "uri"
        },
        "legalName": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "relationship": {
          "type": "string"
        },
        "history": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Places

Locations — places you engage with or reference.

.place

place.add

scope · author effect · write audited v1

Add a place by providing canonical fields directly.

Primary write path for places. Used both for explicitly authored places and for reference stubs created lazily during content ingestion (recipe cuisine origins, article datelines). The caller provides canonical fields; the system handles ID generation, provenance, and storage. No overlay is written — Phase 1 places are reference-only.

REST · POST /places
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "region",
            "neighborhood",
            "continent",
            "other"
          ]
        },
        "partOf": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "place": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "place"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "region",
                "neighborhood",
                "continent",
                "other"
              ]
            },
            "partOf": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "coordinates": {
              "type": "object",
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "lat",
                "lon"
              ],
              "additionalProperties": false
            },
            "description": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "kind"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {},
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "place",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

place.get

scope · reader effect · read v1

Retrieve a place by ID.

Phase 1 places are reference-only — there is no overlay to include or exclude. Returns the full envelope with canonical fields.

REST · GET /places/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "place"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "region",
            "neighborhood",
            "continent",
            "other"
          ]
        },
        "partOf": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

place.ingest_from_url

scope · author effect · write audited v1

Ingest a place from a Wikipedia or Wikidata URL.

Pre-processor for adding places from Wikidata. Maps to PlaceCanonical: name, aliases, description. The `kind` field is best-effort via Wikidata's P31 instance-of (Q515 → city, Q6256 → country, etc.); falls back to `other` when uncertain.

REST · POST /places/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Wikipedia URL, Wikidata URL, or bare Q-id (e.g. Q5301921)."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "place": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "place"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "region",
                "neighborhood",
                "continent",
                "other"
              ]
            },
            "partOf": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "coordinates": {
              "type": "object",
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "lat",
                "lon"
              ],
              "additionalProperties": false
            },
            "description": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "kind"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {},
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "place",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

place.search

scope · reader effect · read v1

Search places by name (trigram), kind, or partOf ref.

Place search via SQL filters: trigram match on canonical.name (uses places_name_trgm GIN index, % operator), eq on kind, JSONB containment on partOf.ref. Trigram threshold defaults to pg_trgm 0.3. Sorted by similarity DESC then updated_at DESC, id DESC. (ISO 3166 code filtering lives on country.search / state.search since W4a.)

REST · GET /places/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "region",
        "neighborhood",
        "continent",
        "other"
      ]
    },
    "partOfId": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "kind"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

place.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a place (admin-tier).

Whole-canonical replacement. The caller sends the complete PlaceCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Phase 1 places have no overlay, so canonical edits are the only editable surface.

REST · PUT /places/:placeId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "placeId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "region",
            "neighborhood",
            "continent",
            "other"
          ]
        },
        "partOf": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "placeId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "place"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "region",
            "neighborhood",
            "continent",
            "other"
          ]
        },
        "partOf": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.restaurant

restaurant.add

scope · author effect · write audited v1

Add a restaurant by providing canonical fields directly.

Primary write path. {restaurant, created} envelope. Optional provenance? override for ingest pre-processors.

REST · POST /restaurants
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "restaurant",
            "cafe",
            "bar",
            "bakery",
            "food-truck",
            "ice-cream-shop",
            "fast-food",
            "pop-up",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "servesCuisine": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "address": {
          "type": "object",
          "properties": {
            "streetAddress": {
              "type": "string"
            },
            "addressLocality": {
              "type": "string"
            },
            "addressRegion": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "addressCountry": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "cityRef": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "telephone": {
          "type": "string"
        },
        "menuUrl": {
          "type": "string",
          "format": "uri"
        },
        "acceptsReservations": {
          "type": "boolean"
        },
        "reservationUrl": {
          "type": "string",
          "format": "uri"
        },
        "openingHours": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "permanentlyClosed": {
          "type": "boolean"
        },
        "openedYear": {
          "type": "integer"
        },
        "closedYear": {
          "type": "integer"
        },
        "chefs": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "parentGroup": {
          "$ref": "#/properties/canonical/properties/cityRef"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired",
            "closed",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "visitLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "occasion": {
                "type": "string"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "dishesHad": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spend": {
                "type": "number"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "reservations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "platform": {
                "type": "string"
              },
              "confirmation": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "partySize"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "favoriteDishes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "summary": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "restaurant": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "restaurant"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "restaurant",
                "cafe",
                "bar",
                "bakery",
                "food-truck",
                "ice-cream-shop",
                "fast-food",
                "pop-up",
                "other"
              ]
            },
            "description": {
              "type": "string"
            },
            "servesCuisine": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "priceRange": {
              "type": "string",
              "enum": [
                "$",
                "$$",
                "$$$",
                "$$$$"
              ]
            },
            "address": {
              "type": "object",
              "properties": {
                "streetAddress": {
                  "type": "string"
                },
                "addressLocality": {
                  "type": "string"
                },
                "addressRegion": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "addressCountry": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "geo": {
              "type": "object",
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "lat",
                "lon"
              ],
              "additionalProperties": false
            },
            "cityRef": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "telephone": {
              "type": "string"
            },
            "menuUrl": {
              "type": "string",
              "format": "uri"
            },
            "acceptsReservations": {
              "type": "boolean"
            },
            "reservationUrl": {
              "type": "string",
              "format": "uri"
            },
            "openingHours": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "permanentlyClosed": {
              "type": "boolean"
            },
            "openedYear": {
              "type": "integer"
            },
            "closedYear": {
              "type": "integer"
            },
            "chefs": {
              "type": "array",
              "items": {
                "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
              },
              "default": []
            },
            "parentGroup": {
              "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "kind"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired",
                "closed",
                "wishlist"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "visitLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "occasion": {
                    "type": "string"
                  },
                  "partySize": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "dishesHad": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "default": []
                  },
                  "spend": {
                    "type": "number"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "reservations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "partySize": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "platform": {
                    "type": "string"
                  },
                  "confirmation": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date",
                  "partySize"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "favoriteDishes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "goingWith": {
              "type": "array",
              "items": {
                "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
              },
              "default": []
            },
            "summary": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "restaurant",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.get

scope · reader effect · read v1

Retrieve a full restaurant by ID, including canonical and overlay.

REST · GET /restaurants/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "restaurant"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "restaurant",
            "cafe",
            "bar",
            "bakery",
            "food-truck",
            "ice-cream-shop",
            "fast-food",
            "pop-up",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "servesCuisine": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "address": {
          "type": "object",
          "properties": {
            "streetAddress": {
              "type": "string"
            },
            "addressLocality": {
              "type": "string"
            },
            "addressRegion": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "addressCountry": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "cityRef": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "telephone": {
          "type": "string"
        },
        "menuUrl": {
          "type": "string",
          "format": "uri"
        },
        "acceptsReservations": {
          "type": "boolean"
        },
        "reservationUrl": {
          "type": "string",
          "format": "uri"
        },
        "openingHours": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "permanentlyClosed": {
          "type": "boolean"
        },
        "openedYear": {
          "type": "integer"
        },
        "closedYear": {
          "type": "integer"
        },
        "chefs": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "parentGroup": {
          "$ref": "#/properties/canonical/properties/cityRef"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired",
            "closed",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "visitLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "occasion": {
                "type": "string"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "dishesHad": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spend": {
                "type": "number"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "reservations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "platform": {
                "type": "string"
              },
              "confirmation": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "partySize"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "favoriteDishes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "summary": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.ingest_from_url

scope · author effect · write audited v1

Ingest a restaurant from a Wikipedia or Wikidata URL.

Wikidata-backed (Q11707 = restaurant + sibling Q-ids for cafe/bar/etc). Phase 1 supports Wikipedia/Wikidata URLs and bare Q-ids only — Google Places + Yelp lookups need API keys and are deferred to Phase A1.

REST · POST /restaurants/ingest
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    }
  },
  "required": [
    "url"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "restaurant": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "restaurant"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "restaurant",
                "cafe",
                "bar",
                "bakery",
                "food-truck",
                "ice-cream-shop",
                "fast-food",
                "pop-up",
                "other"
              ]
            },
            "description": {
              "type": "string"
            },
            "servesCuisine": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "priceRange": {
              "type": "string",
              "enum": [
                "$",
                "$$",
                "$$$",
                "$$$$"
              ]
            },
            "address": {
              "type": "object",
              "properties": {
                "streetAddress": {
                  "type": "string"
                },
                "addressLocality": {
                  "type": "string"
                },
                "addressRegion": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "addressCountry": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "geo": {
              "type": "object",
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "lat",
                "lon"
              ],
              "additionalProperties": false
            },
            "cityRef": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "telephone": {
              "type": "string"
            },
            "menuUrl": {
              "type": "string",
              "format": "uri"
            },
            "acceptsReservations": {
              "type": "boolean"
            },
            "reservationUrl": {
              "type": "string",
              "format": "uri"
            },
            "openingHours": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "permanentlyClosed": {
              "type": "boolean"
            },
            "openedYear": {
              "type": "integer"
            },
            "closedYear": {
              "type": "integer"
            },
            "chefs": {
              "type": "array",
              "items": {
                "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
              },
              "default": []
            },
            "parentGroup": {
              "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
            },
            "sourceText": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "kind"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired",
                "closed",
                "wishlist"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "visitLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "occasion": {
                    "type": "string"
                  },
                  "partySize": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "rating": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "dishesHad": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "default": []
                  },
                  "spend": {
                    "type": "number"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "reservations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "partySize": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "platform": {
                    "type": "string"
                  },
                  "confirmation": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date",
                  "partySize"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "favoriteDishes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "goingWith": {
              "type": "array",
              "items": {
                "$ref": "#/properties/restaurant/properties/canonical/properties/cityRef"
              },
              "default": []
            },
            "summary": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    },
    "extraction": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "wikidata",
            "cached"
          ]
        },
        "qid": {
          "type": "string"
        },
        "ms": {
          "type": "number"
        }
      },
      "required": [
        "source",
        "qid",
        "ms"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "restaurant",
    "created",
    "extraction"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.log_visit

scope · author effect · write audited v1

Append a visit-log entry to a restaurant overlay.

Append-only. Updates overall rating to mean when updateOverallRating=true.

REST · POST /restaurants/:restaurantId/visits
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "restaurantId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "occasion": {
          "type": "string"
        },
        "partySize": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "dishesHad": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "spend": {
          "type": "number"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    },
    "updateOverallRating": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "restaurantId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "visitLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "occasion": {
          "type": "string"
        },
        "partySize": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "dishesHad": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "spend": {
          "type": "number"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "visitLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.search

scope · reader effect · read v1

Search restaurants by name (trigram), cuisine, city, price, status.

Trigram match on canonical.name (restaurants_name_trgm GIN index). Filter by kind, cuisine containment, city substring on address, price range, overlay status/rating.

REST · GET /restaurants/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "restaurant",
        "cafe",
        "bar",
        "bakery",
        "food-truck",
        "ice-cream-shop",
        "fast-food",
        "pop-up",
        "other"
      ]
    },
    "cuisine": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "priceRange": {
      "type": "string",
      "enum": [
        "$",
        "$$",
        "$$$",
        "$$$$"
      ]
    },
    "city": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "untried",
        "tried",
        "regular",
        "retired",
        "closed",
        "wishlist"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "cuisine": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "city": {
            "type": "string"
          },
          "priceRange": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "cuisine"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a restaurant (admin-tier).

Whole-canonical replacement. The caller sends the complete RestaurantCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /restaurants/:restaurantId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "restaurantId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "restaurant",
            "cafe",
            "bar",
            "bakery",
            "food-truck",
            "ice-cream-shop",
            "fast-food",
            "pop-up",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "servesCuisine": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "address": {
          "type": "object",
          "properties": {
            "streetAddress": {
              "type": "string"
            },
            "addressLocality": {
              "type": "string"
            },
            "addressRegion": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "addressCountry": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "cityRef": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "telephone": {
          "type": "string"
        },
        "menuUrl": {
          "type": "string",
          "format": "uri"
        },
        "acceptsReservations": {
          "type": "boolean"
        },
        "reservationUrl": {
          "type": "string",
          "format": "uri"
        },
        "openingHours": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "permanentlyClosed": {
          "type": "boolean"
        },
        "openedYear": {
          "type": "integer"
        },
        "closedYear": {
          "type": "integer"
        },
        "chefs": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "parentGroup": {
          "$ref": "#/properties/canonical/properties/cityRef"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "restaurantId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "restaurant"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "restaurant",
            "cafe",
            "bar",
            "bakery",
            "food-truck",
            "ice-cream-shop",
            "fast-food",
            "pop-up",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "servesCuisine": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "address": {
          "type": "object",
          "properties": {
            "streetAddress": {
              "type": "string"
            },
            "addressLocality": {
              "type": "string"
            },
            "addressRegion": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "addressCountry": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "cityRef": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "telephone": {
          "type": "string"
        },
        "menuUrl": {
          "type": "string",
          "format": "uri"
        },
        "acceptsReservations": {
          "type": "boolean"
        },
        "reservationUrl": {
          "type": "string",
          "format": "uri"
        },
        "openingHours": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "permanentlyClosed": {
          "type": "boolean"
        },
        "openedYear": {
          "type": "integer"
        },
        "closedYear": {
          "type": "integer"
        },
        "chefs": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "parentGroup": {
          "$ref": "#/properties/canonical/properties/cityRef"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired",
            "closed",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "visitLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "occasion": {
                "type": "string"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "dishesHad": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spend": {
                "type": "number"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "reservations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "platform": {
                "type": "string"
              },
              "confirmation": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "partySize"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "favoriteDishes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "summary": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

restaurant.update_overlay

scope · author effect · write audited v1

Update overlay fields on a restaurant.

REST · PATCH /restaurants/:restaurantId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "restaurantId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired",
            "closed",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "visitLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "occasion": {
                "type": "string"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "dishesHad": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spend": {
                "type": "number"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "reservations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "platform": {
                "type": "string"
              },
              "confirmation": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "partySize"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "favoriteDishes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "goingWith": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "summary": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "restaurantId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "restaurant"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "restaurant",
            "cafe",
            "bar",
            "bakery",
            "food-truck",
            "ice-cream-shop",
            "fast-food",
            "pop-up",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "servesCuisine": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "priceRange": {
          "type": "string",
          "enum": [
            "$",
            "$$",
            "$$$",
            "$$$$"
          ]
        },
        "address": {
          "type": "object",
          "properties": {
            "streetAddress": {
              "type": "string"
            },
            "addressLocality": {
              "type": "string"
            },
            "addressRegion": {
              "type": "string"
            },
            "postalCode": {
              "type": "string"
            },
            "addressCountry": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "cityRef": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "telephone": {
          "type": "string"
        },
        "menuUrl": {
          "type": "string",
          "format": "uri"
        },
        "acceptsReservations": {
          "type": "boolean"
        },
        "reservationUrl": {
          "type": "string",
          "format": "uri"
        },
        "openingHours": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "permanentlyClosed": {
          "type": "boolean"
        },
        "openedYear": {
          "type": "integer"
        },
        "closedYear": {
          "type": "integer"
        },
        "chefs": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "parentGroup": {
          "$ref": "#/properties/canonical/properties/cityRef"
        },
        "sourceText": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired",
            "closed",
            "wishlist"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "visitLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "occasion": {
                "type": "string"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "rating": {
                "type": "number",
                "minimum": 1,
                "maximum": 10
              },
              "dishesHad": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "default": []
              },
              "spend": {
                "type": "number"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "reservations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "partySize": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "platform": {
                "type": "string"
              },
              "confirmation": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date",
              "partySize"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "favoriteDishes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/cityRef"
          },
          "default": []
        },
        "summary": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.country

country.add

scope · author effect · write audited v1

Add a country by providing canonical fields directly.

Primary write path. {country, created} envelope (family-consistent). No automatic dedup; ISO 3166-1 alpha-2 collisions surface as DB unique-violation errors (when the unique index is added) — for now rely on the resolver / human review to dedup.

REST · POST /countries
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "iso3166_1": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "iso3166_1_alpha3": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "iso3166_1_numeric": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "continent": {
          "type": "string",
          "enum": [
            "africa",
            "antarctica",
            "asia",
            "europe",
            "north-america",
            "oceania",
            "south-america"
          ]
        },
        "capital": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "officialLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "callingCode": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "iso3166_1"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "visitedRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "country": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "country"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "iso3166_1": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            },
            "iso3166_1_alpha3": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "iso3166_1_numeric": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "description": {
              "type": "string"
            },
            "demonym": {
              "type": "string"
            },
            "continent": {
              "type": "string",
              "enum": [
                "africa",
                "antarctica",
                "asia",
                "europe",
                "north-america",
                "oceania",
                "south-america"
              ]
            },
            "capital": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "officialLanguages": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "currency": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "callingCode": {
              "type": "string"
            },
            "timezones": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "iso3166_1"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "none",
                "wishlist",
                "transit",
                "visited",
                "lived"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "firstVisit": {
              "type": "string",
              "format": "date"
            },
            "lastVisit": {
              "type": "string",
              "format": "date"
            },
            "totalDaysLived": {
              "type": "integer",
              "minimum": 0
            },
            "visitedRegions": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "country",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

country.get

scope · reader effect · read v1

Retrieve a full country by ID, including canonical and overlay.

REST · GET /countries/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "country"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "iso3166_1": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "iso3166_1_alpha3": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "iso3166_1_numeric": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "continent": {
          "type": "string",
          "enum": [
            "africa",
            "antarctica",
            "asia",
            "europe",
            "north-america",
            "oceania",
            "south-america"
          ]
        },
        "capital": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "officialLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "callingCode": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "iso3166_1"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "visitedRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

country.search

scope · reader effect · read v1

Search countries by name (trigram), ISO code, continent, status.

Trigram match on canonical.name (countries_title_trgm GIN index). Filters by ISO 3166-1 alpha-2, continent, and overlay status. Cursor pagination.

REST · GET /countries/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "iso3166_1": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "continent": {
      "type": "string",
      "enum": [
        "africa",
        "antarctica",
        "asia",
        "europe",
        "north-america",
        "oceania",
        "south-america"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "none",
        "wishlist",
        "transit",
        "visited",
        "lived"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "iso3166_1": {
            "type": "string"
          },
          "continent": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

country.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a country (admin-tier).

Whole-canonical replacement. The caller sends the complete CountryCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /countries/:countryId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "countryId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "iso3166_1": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "iso3166_1_alpha3": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "iso3166_1_numeric": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "continent": {
          "type": "string",
          "enum": [
            "africa",
            "antarctica",
            "asia",
            "europe",
            "north-america",
            "oceania",
            "south-america"
          ]
        },
        "capital": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "officialLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "callingCode": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "iso3166_1"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "countryId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "country"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "iso3166_1": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "iso3166_1_alpha3": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "iso3166_1_numeric": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "continent": {
          "type": "string",
          "enum": [
            "africa",
            "antarctica",
            "asia",
            "europe",
            "north-america",
            "oceania",
            "south-america"
          ]
        },
        "capital": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "officialLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "callingCode": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "iso3166_1"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "visitedRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

country.update_overlay

scope · author effect · write audited v1

Update overlay fields on a country (status, visits, rating, notes).

REST · PATCH /countries/:countryId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "countryId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "visitedRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "countryId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "country"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "iso3166_1": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "iso3166_1_alpha3": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "iso3166_1_numeric": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "continent": {
          "type": "string",
          "enum": [
            "africa",
            "antarctica",
            "asia",
            "europe",
            "north-america",
            "oceania",
            "south-america"
          ]
        },
        "capital": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "officialLanguages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "callingCode": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "iso3166_1"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "visitedRegions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.state

state.add

scope · author effect · write audited v1

Add a state by providing canonical fields directly.

REST · POST /states
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "state",
            "province",
            "prefecture",
            "region",
            "territory",
            "oblast",
            "canton",
            "land",
            "department",
            "autonomous-community",
            "other"
          ],
          "default": "state"
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "iso3166_2": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "capitalCity": {
          "$ref": "#/properties/canonical/properties/containedInPlace"
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "state": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "state"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "kind": {
              "type": "string",
              "enum": [
                "state",
                "province",
                "prefecture",
                "region",
                "territory",
                "oblast",
                "canton",
                "land",
                "department",
                "autonomous-community",
                "other"
              ],
              "default": "state"
            },
            "containedInPlace": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "iso3166_2": {
              "type": "string"
            },
            "abbreviation": {
              "type": "string"
            },
            "capitalCity": {
              "$ref": "#/properties/state/properties/canonical/properties/containedInPlace"
            },
            "description": {
              "type": "string"
            },
            "demonym": {
              "type": "string"
            },
            "timezones": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "containedInPlace"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "none",
                "wishlist",
                "transit",
                "visited",
                "lived"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "firstVisit": {
              "type": "string",
              "format": "date"
            },
            "lastVisit": {
              "type": "string",
              "format": "date"
            },
            "totalDaysLived": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "state",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

state.get

scope · reader effect · read v1

Retrieve a full state by ID, including canonical and overlay.

REST · GET /states/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "state"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "state",
            "province",
            "prefecture",
            "region",
            "territory",
            "oblast",
            "canton",
            "land",
            "department",
            "autonomous-community",
            "other"
          ],
          "default": "state"
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "iso3166_2": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "capitalCity": {
          "$ref": "#/properties/canonical/properties/containedInPlace"
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

state.search

scope · reader effect · read v1

Search states by name (trigram), ISO subdivision code, parent country, or kind.

Trigram match on canonical.name (states_title_trgm GIN index). Filters by ISO 3166-2 code, parent country (containedInPlace.ref), administrative kind, overlay status. Cursor pagination.

REST · GET /states/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "iso3166_2": {
      "type": "string"
    },
    "containedInPlaceId": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "state",
        "province",
        "prefecture",
        "region",
        "territory",
        "oblast",
        "canton",
        "land",
        "department",
        "autonomous-community",
        "other"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "none",
        "wishlist",
        "transit",
        "visited",
        "lived"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "iso3166_2": {
            "type": "string"
          },
          "containedInPlace": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

state.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a state (admin-tier).

Whole-canonical replacement. Sets embedding_stale_at=now(). Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /states/:stateId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "stateId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "state",
            "province",
            "prefecture",
            "region",
            "territory",
            "oblast",
            "canton",
            "land",
            "department",
            "autonomous-community",
            "other"
          ],
          "default": "state"
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "iso3166_2": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "capitalCity": {
          "$ref": "#/properties/canonical/properties/containedInPlace"
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "stateId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "state"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "state",
            "province",
            "prefecture",
            "region",
            "territory",
            "oblast",
            "canton",
            "land",
            "department",
            "autonomous-community",
            "other"
          ],
          "default": "state"
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "iso3166_2": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "capitalCity": {
          "$ref": "#/properties/canonical/properties/containedInPlace"
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

state.update_overlay

scope · author effect · write audited v1

Update overlay fields on a state (status, visits, rating, notes).

REST · PATCH /states/:stateId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "stateId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "stateId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "state"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "kind": {
          "type": "string",
          "enum": [
            "state",
            "province",
            "prefecture",
            "region",
            "territory",
            "oblast",
            "canton",
            "land",
            "department",
            "autonomous-community",
            "other"
          ],
          "default": "state"
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "iso3166_2": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "capitalCity": {
          "$ref": "#/properties/canonical/properties/containedInPlace"
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "timezones": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.city

city.add

scope · author effect · write audited v1

Add a city by providing canonical fields directly.

REST · POST /cities
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "timezone": {
          "type": "string"
        },
        "population": {
          "type": "integer",
          "minimum": 0
        },
        "populationYear": {
          "type": "integer"
        },
        "iata": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "foundedYear": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "neighborhoods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "city": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "city"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "containedInPlace": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "geo": {
              "type": "object",
              "properties": {
                "lat": {
                  "type": "number",
                  "minimum": -90,
                  "maximum": 90
                },
                "lon": {
                  "type": "number",
                  "minimum": -180,
                  "maximum": 180
                }
              },
              "required": [
                "lat",
                "lon"
              ],
              "additionalProperties": false
            },
            "timezone": {
              "type": "string"
            },
            "population": {
              "type": "integer",
              "minimum": 0
            },
            "populationYear": {
              "type": "integer"
            },
            "iata": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "description": {
              "type": "string"
            },
            "demonym": {
              "type": "string"
            },
            "foundedYear": {
              "type": "integer"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "containedInPlace"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "none",
                "wishlist",
                "transit",
                "visited",
                "lived"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "firstVisit": {
              "type": "string",
              "format": "date"
            },
            "lastVisit": {
              "type": "string",
              "format": "date"
            },
            "totalDaysLived": {
              "type": "integer",
              "minimum": 0
            },
            "neighborhoods": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "city",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

city.get

scope · reader effect · read v1

Retrieve a full city by ID, including canonical and overlay.

REST · GET /cities/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "city"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "timezone": {
          "type": "string"
        },
        "population": {
          "type": "integer",
          "minimum": 0
        },
        "populationYear": {
          "type": "integer"
        },
        "iata": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "foundedYear": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "neighborhoods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

city.search

scope · reader effect · read v1

Search cities by name (trigram), IATA code, parent place, or status.

Trigram match on canonical.name (cities_title_trgm GIN index). Filters by IATA, parent place (containedInPlace.ref — matches state or country), overlay status. Cursor pagination.

REST · GET /cities/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "iata": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "containedInPlaceId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "none",
        "wishlist",
        "transit",
        "visited",
        "lived"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "containedInPlace": {
            "type": "string"
          },
          "iata": {
            "type": "string"
          },
          "population": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

city.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a city (admin-tier).

Whole-canonical replacement. Sets embedding_stale_at=now(). Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /cities/:cityId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "cityId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "timezone": {
          "type": "string"
        },
        "population": {
          "type": "integer",
          "minimum": 0
        },
        "populationYear": {
          "type": "integer"
        },
        "iata": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "foundedYear": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "cityId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "city"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "timezone": {
          "type": "string"
        },
        "population": {
          "type": "integer",
          "minimum": 0
        },
        "populationYear": {
          "type": "integer"
        },
        "iata": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "foundedYear": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "neighborhoods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

city.update_overlay

scope · author effect · write audited v1

Update overlay fields on a city (status, visits, neighborhoods, rating, notes).

REST · PATCH /cities/:cityId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "cityId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "neighborhoods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "cityId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "city"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "containedInPlace": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "geo": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          },
          "required": [
            "lat",
            "lon"
          ],
          "additionalProperties": false
        },
        "timezone": {
          "type": "string"
        },
        "population": {
          "type": "integer",
          "minimum": 0
        },
        "populationYear": {
          "type": "integer"
        },
        "iata": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "description": {
          "type": "string"
        },
        "demonym": {
          "type": "string"
        },
        "foundedYear": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "containedInPlace"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "none",
            "wishlist",
            "transit",
            "visited",
            "lived"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "firstVisit": {
          "type": "string",
          "format": "date"
        },
        "lastVisit": {
          "type": "string",
          "format": "date"
        },
        "totalDaysLived": {
          "type": "integer",
          "minimum": 0
        },
        "neighborhoods": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Events

Bounded occurrences in time — games, concerts, conferences, dinners.

.event

event.add

scope · author effect · write audited v1

Add an event by providing canonical fields directly.

Primary write path. {event, created} envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (when built).

REST · POST /events
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "event"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "startDate": {
              "type": "string",
              "format": "date-time"
            },
            "endDate": {
              "type": "string",
              "format": "date-time"
            },
            "location": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "performer": {
              "type": "array",
              "items": {
                "$ref": "#/properties/event/properties/canonical/properties/location"
              },
              "default": []
            },
            "organizer": {
              "$ref": "#/properties/event/properties/canonical/properties/location"
            },
            "eventStatus": {
              "type": "string",
              "enum": [
                "scheduled",
                "rescheduled",
                "postponed",
                "cancelled"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "startDate"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "interested",
                "going",
                "attended",
                "missed"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "goingWith": {
              "type": "array",
              "items": {
                "$ref": "#/properties/event/properties/canonical/properties/location"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "event",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

event.get

scope · reader effect · read v1

Retrieve a full event by ID, including canonical and overlay.

REST · GET /events/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

event.search

scope · reader effect · read v1

Search events by name (trigram), location, organizer, status.

Trigram match on canonical.name (events_title_trgm GIN index). Filters by location substring, organizer substring, event status, attendance status. Cursor pagination.

REST · GET /events/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "organizer": {
      "type": "string"
    },
    "eventStatus": {
      "type": "string",
      "enum": [
        "scheduled",
        "rescheduled",
        "postponed",
        "cancelled"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "interested",
        "going",
        "attended",
        "missed"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "organizer": {
            "type": "string"
          },
          "eventStatus": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

event.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on an event (admin-tier).

Whole-canonical replacement. The caller sends the complete EventCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /events/:eventId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "eventId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "eventId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

event.update_overlay

scope · author effect · write audited v1

Update overlay fields on an event (status, rating, goingWith, etc.).

REST · PATCH /events/:eventId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "eventId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "goingWith": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "eventId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.sports_event

sports_event.add

scope · author effect · write audited v1

Add a sports event by providing canonical fields directly.

REST · POST /sports-events
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "sport": {
          "type": "string"
        },
        "homeTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "awayTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "competitors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "score": {
          "type": "object",
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          },
          "required": [
            "home",
            "away"
          ],
          "additionalProperties": false
        },
        "league": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate",
        "sport"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "sports_event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "sports_event"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "startDate": {
              "type": "string",
              "format": "date-time"
            },
            "endDate": {
              "type": "string",
              "format": "date-time"
            },
            "location": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "sport": {
              "type": "string"
            },
            "homeTeam": {
              "$ref": "#/properties/sports_event/properties/canonical/properties/location"
            },
            "awayTeam": {
              "$ref": "#/properties/sports_event/properties/canonical/properties/location"
            },
            "competitors": {
              "type": "array",
              "items": {
                "$ref": "#/properties/sports_event/properties/canonical/properties/location"
              },
              "default": []
            },
            "score": {
              "type": "object",
              "properties": {
                "home": {
                  "type": "number"
                },
                "away": {
                  "type": "number"
                }
              },
              "required": [
                "home",
                "away"
              ],
              "additionalProperties": false
            },
            "league": {
              "$ref": "#/properties/sports_event/properties/canonical/properties/location"
            },
            "organizer": {
              "$ref": "#/properties/sports_event/properties/canonical/properties/location"
            },
            "eventStatus": {
              "type": "string",
              "enum": [
                "scheduled",
                "rescheduled",
                "postponed",
                "cancelled"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "startDate",
            "sport"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "interested",
                "going",
                "attended",
                "missed"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "seatLocation": {
              "type": "string"
            },
            "pricePaid": {
              "type": "number"
            },
            "currency": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "goingWith": {
              "type": "array",
              "items": {
                "$ref": "#/properties/sports_event/properties/canonical/properties/location"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "sports_event",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sports_event.get

scope · reader effect · read v1

Retrieve a full sports event by ID.

REST · GET /sports-events/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "sports_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "sport": {
          "type": "string"
        },
        "homeTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "awayTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "competitors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "score": {
          "type": "object",
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          },
          "required": [
            "home",
            "away"
          ],
          "additionalProperties": false
        },
        "league": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate",
        "sport"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sports_event.search

scope · reader effect · read v1

Search sports events by name, sport, team, league, status.

Trigram match on canonical.name (sports_events_title_trgm GIN index). Filters by sport, home/away team substring, league, event status, attendance status. Cursor pagination.

REST · GET /sports-events/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "sport": {
      "type": "string"
    },
    "homeTeam": {
      "type": "string"
    },
    "awayTeam": {
      "type": "string"
    },
    "league": {
      "type": "string"
    },
    "eventStatus": {
      "type": "string",
      "enum": [
        "scheduled",
        "rescheduled",
        "postponed",
        "cancelled"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "interested",
        "going",
        "attended",
        "missed"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "sport": {
            "type": "string"
          },
          "homeTeam": {
            "type": "string"
          },
          "awayTeam": {
            "type": "string"
          },
          "league": {
            "type": "string"
          },
          "eventStatus": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sports_event.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a sports event (admin-tier).

REST · PUT /sports-events/:sportsEventId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "sportsEventId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "sport": {
          "type": "string"
        },
        "homeTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "awayTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "competitors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "score": {
          "type": "object",
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          },
          "required": [
            "home",
            "away"
          ],
          "additionalProperties": false
        },
        "league": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate",
        "sport"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "sportsEventId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "sports_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "sport": {
          "type": "string"
        },
        "homeTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "awayTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "competitors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "score": {
          "type": "object",
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          },
          "required": [
            "home",
            "away"
          ],
          "additionalProperties": false
        },
        "league": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate",
        "sport"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

sports_event.update_overlay

scope · author effect · write audited v1

Update overlay fields on a sports event.

REST · PATCH /sports-events/:sportsEventId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "sportsEventId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "sportsEventId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "sports_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "sport": {
          "type": "string"
        },
        "homeTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "awayTeam": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "competitors": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "score": {
          "type": "object",
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          },
          "required": [
            "home",
            "away"
          ],
          "additionalProperties": false
        },
        "league": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate",
        "sport"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.music_event

music_event.add

scope · author effect · write audited v1

Add a music event by providing canonical fields directly.

REST · POST /music-events
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "headliner": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "tour": {
          "type": "string"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "music_event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "music_event"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "startDate": {
              "type": "string",
              "format": "date-time"
            },
            "endDate": {
              "type": "string",
              "format": "date-time"
            },
            "location": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "performer": {
              "type": "array",
              "items": {
                "$ref": "#/properties/music_event/properties/canonical/properties/location"
              },
              "default": []
            },
            "headliner": {
              "$ref": "#/properties/music_event/properties/canonical/properties/location"
            },
            "tour": {
              "type": "string"
            },
            "organizer": {
              "$ref": "#/properties/music_event/properties/canonical/properties/location"
            },
            "eventStatus": {
              "type": "string",
              "enum": [
                "scheduled",
                "rescheduled",
                "postponed",
                "cancelled"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "startDate"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "interested",
                "going",
                "attended",
                "missed"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "seatLocation": {
              "type": "string"
            },
            "pricePaid": {
              "type": "number"
            },
            "currency": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3
            },
            "goingWith": {
              "type": "array",
              "items": {
                "$ref": "#/properties/music_event/properties/canonical/properties/location"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "music_event",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music_event.get

scope · reader effect · read v1

Retrieve a full music event by ID.

REST · GET /music-events/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "headliner": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "tour": {
          "type": "string"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music_event.search

scope · reader effect · read v1

Search music events by name, location, headliner, tour, status.

Trigram match on canonical.name (music_events_title_trgm GIN). Filters by location substring, headliner substring, tour, event status, attendance status. Cursor pagination.

REST · GET /music-events/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "headliner": {
      "type": "string"
    },
    "tour": {
      "type": "string"
    },
    "eventStatus": {
      "type": "string",
      "enum": [
        "scheduled",
        "rescheduled",
        "postponed",
        "cancelled"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "interested",
        "going",
        "attended",
        "missed"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "headliner": {
            "type": "string"
          },
          "tour": {
            "type": "string"
          },
          "eventStatus": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music_event.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a music event (admin-tier).

REST · PUT /music-events/:musicEventId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "musicEventId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "headliner": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "tour": {
          "type": "string"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "musicEventId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "headliner": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "tour": {
          "type": "string"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

music_event.update_overlay

scope · author effect · write audited v1

Update overlay fields on a music event.

REST · PATCH /music-events/:musicEventId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "musicEventId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "musicEventId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "music_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "performer": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "headliner": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "tour": {
          "type": "string"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "seatLocation": {
          "type": "string"
        },
        "pricePaid": {
          "type": "number"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "goingWith": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.business_event

business_event.add

scope · author effect · write audited v1

Add a business event by providing canonical fields directly.

REST · POST /business-events
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "eventType": {
          "type": "string",
          "enum": [
            "conference",
            "summit",
            "workshop",
            "keynote",
            "meeting",
            "panel",
            "roundtable",
            "training",
            "launch",
            "press-event",
            "other"
          ],
          "default": "conference"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "speakers": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "host": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "attendee",
            "speaker",
            "sponsor",
            "host",
            "press"
          ]
        },
        "talkTitle": {
          "type": "string"
        },
        "badgeNumber": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "business_event": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "business_event"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "startDate": {
              "type": "string",
              "format": "date-time"
            },
            "endDate": {
              "type": "string",
              "format": "date-time"
            },
            "location": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "eventType": {
              "type": "string",
              "enum": [
                "conference",
                "summit",
                "workshop",
                "keynote",
                "meeting",
                "panel",
                "roundtable",
                "training",
                "launch",
                "press-event",
                "other"
              ],
              "default": "conference"
            },
            "topics": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "speakers": {
              "type": "array",
              "items": {
                "$ref": "#/properties/business_event/properties/canonical/properties/location"
              },
              "default": []
            },
            "host": {
              "$ref": "#/properties/business_event/properties/canonical/properties/location"
            },
            "organizer": {
              "$ref": "#/properties/business_event/properties/canonical/properties/location"
            },
            "eventStatus": {
              "type": "string",
              "enum": [
                "scheduled",
                "rescheduled",
                "postponed",
                "cancelled"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name",
            "startDate"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "interested",
                "going",
                "attended",
                "missed"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "role": {
              "type": "string",
              "enum": [
                "attendee",
                "speaker",
                "sponsor",
                "host",
                "press"
              ]
            },
            "talkTitle": {
              "type": "string"
            },
            "badgeNumber": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "business_event",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

business_event.get

scope · reader effect · read v1

Retrieve a full business event by ID.

REST · GET /business-events/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "business_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "eventType": {
          "type": "string",
          "enum": [
            "conference",
            "summit",
            "workshop",
            "keynote",
            "meeting",
            "panel",
            "roundtable",
            "training",
            "launch",
            "press-event",
            "other"
          ],
          "default": "conference"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "speakers": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "host": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "attendee",
            "speaker",
            "sponsor",
            "host",
            "press"
          ]
        },
        "talkTitle": {
          "type": "string"
        },
        "badgeNumber": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

business_event.search

scope · reader effect · read v1

Search business events by name, type, host, topic, status, role.

Trigram match on canonical.name (business_events_title_trgm GIN). Filters by eventType, host substring, topic substring (against any topics[] entry), event status, attendance status, attendee role. Cursor pagination.

REST · GET /business-events/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "eventType": {
      "type": "string",
      "enum": [
        "conference",
        "summit",
        "workshop",
        "keynote",
        "meeting",
        "panel",
        "roundtable",
        "training",
        "launch",
        "press-event",
        "other"
      ]
    },
    "host": {
      "type": "string"
    },
    "topic": {
      "type": "string"
    },
    "eventStatus": {
      "type": "string",
      "enum": [
        "scheduled",
        "rescheduled",
        "postponed",
        "cancelled"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "interested",
        "going",
        "attended",
        "missed"
      ]
    },
    "role": {
      "type": "string",
      "enum": [
        "attendee",
        "speaker",
        "sponsor",
        "host",
        "press"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "eventStatus": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

business_event.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a business event (admin-tier).

REST · PUT /business-events/:businessEventId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "businessEventId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "eventType": {
          "type": "string",
          "enum": [
            "conference",
            "summit",
            "workshop",
            "keynote",
            "meeting",
            "panel",
            "roundtable",
            "training",
            "launch",
            "press-event",
            "other"
          ],
          "default": "conference"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "speakers": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "host": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "businessEventId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "business_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "eventType": {
          "type": "string",
          "enum": [
            "conference",
            "summit",
            "workshop",
            "keynote",
            "meeting",
            "panel",
            "roundtable",
            "training",
            "launch",
            "press-event",
            "other"
          ],
          "default": "conference"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "speakers": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "host": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "attendee",
            "speaker",
            "sponsor",
            "host",
            "press"
          ]
        },
        "talkTitle": {
          "type": "string"
        },
        "badgeNumber": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

business_event.update_overlay

scope · author effect · write audited v1

Update overlay fields on a business event.

REST · PATCH /business-events/:businessEventId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "businessEventId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "attendee",
            "speaker",
            "sponsor",
            "host",
            "press"
          ]
        },
        "talkTitle": {
          "type": "string"
        },
        "badgeNumber": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "businessEventId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "business_event"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "location": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "eventType": {
          "type": "string",
          "enum": [
            "conference",
            "summit",
            "workshop",
            "keynote",
            "meeting",
            "panel",
            "roundtable",
            "training",
            "launch",
            "press-event",
            "other"
          ],
          "default": "conference"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "speakers": {
          "type": "array",
          "items": {
            "$ref": "#/properties/canonical/properties/location"
          },
          "default": []
        },
        "host": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "organizer": {
          "$ref": "#/properties/canonical/properties/location"
        },
        "eventStatus": {
          "type": "string",
          "enum": [
            "scheduled",
            "rescheduled",
            "postponed",
            "cancelled"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name",
        "startDate"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "interested",
            "going",
            "attended",
            "missed"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "role": {
          "type": "string",
          "enum": [
            "attendee",
            "speaker",
            "sponsor",
            "host",
            "press"
          ]
        },
        "talkTitle": {
          "type": "string"
        },
        "badgeNumber": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Projects

Ongoing efforts in flight — ventures, campaigns, creative work.

.project

project.add

scope · author effect · write audited v1

Add a project by providing canonical fields directly.

REST · POST /projects
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "completed",
            "archived",
            "cancelled"
          ],
          "default": "active"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lead": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "parentOf": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ]
        },
        "lastTouched": {
          "type": "string",
          "format": "date"
        },
        "nextAction": {
          "type": "string"
        },
        "relatedDocs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "project": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "project"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "aliases": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "description": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "paused",
                "completed",
                "archived",
                "cancelled"
              ],
              "default": "active"
            },
            "startDate": {
              "type": "string",
              "format": "date"
            },
            "endDate": {
              "type": "string",
              "format": "date"
            },
            "topics": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "members": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "ref": {
                    "type": "string"
                  },
                  "matchConfidence": {
                    "type": "string",
                    "enum": [
                      "exact",
                      "fuzzy",
                      "unresolved",
                      "pending_review"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "default": []
            },
            "lead": {
              "$ref": "#/properties/project/properties/canonical/properties/members/items"
            },
            "parentOf": {
              "$ref": "#/properties/project/properties/canonical/properties/members/items"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "untried",
                "tried",
                "regular",
                "retired"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "priority": {
              "type": "string",
              "enum": [
                "p0",
                "p1",
                "p2",
                "p3"
              ]
            },
            "lastTouched": {
              "type": "string",
              "format": "date"
            },
            "nextAction": {
              "type": "string"
            },
            "relatedDocs": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "project",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

project.get

scope · reader effect · read v1

Retrieve a full project by ID.

REST · GET /projects/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "project"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "completed",
            "archived",
            "cancelled"
          ],
          "default": "active"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lead": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "parentOf": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ]
        },
        "lastTouched": {
          "type": "string",
          "format": "date"
        },
        "nextAction": {
          "type": "string"
        },
        "relatedDocs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

project.search

scope · reader effect · read v1

Search projects by name, status, topic, lead, priority.

Trigram match on canonical.name (projects_title_trgm GIN index). Filters by status, topic substring against any topics[] entry, lead (person ULID), overlay priority. Cursor pagination.

REST · GET /projects/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "completed",
        "archived",
        "cancelled"
      ]
    },
    "topic": {
      "type": "string"
    },
    "leadId": {
      "type": "string"
    },
    "priority": {
      "type": "string",
      "enum": [
        "p0",
        "p1",
        "p2",
        "p3"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "lead": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

project.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a project (admin-tier).

REST · PUT /projects/:projectId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "completed",
            "archived",
            "cancelled"
          ],
          "default": "active"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lead": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "parentOf": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "projectId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "project"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "completed",
            "archived",
            "cancelled"
          ],
          "default": "active"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lead": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "parentOf": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ]
        },
        "lastTouched": {
          "type": "string",
          "format": "date"
        },
        "nextAction": {
          "type": "string"
        },
        "relatedDocs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

project.update_overlay

scope · author effect · write audited v1

Update overlay fields on a project (priority, next-action, last-touched, related-docs, notes).

REST · PATCH /projects/:projectId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ]
        },
        "lastTouched": {
          "type": "string",
          "format": "date"
        },
        "nextAction": {
          "type": "string"
        },
        "relatedDocs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "projectId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "project"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "paused",
            "completed",
            "archived",
            "cancelled"
          ],
          "default": "active"
        },
        "startDate": {
          "type": "string",
          "format": "date"
        },
        "endDate": {
          "type": "string",
          "format": "date"
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "ref": {
                "type": "string"
              },
              "matchConfidence": {
                "type": "string",
                "enum": [
                  "exact",
                  "fuzzy",
                  "unresolved",
                  "pending_review"
                ]
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "lead": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "parentOf": {
          "$ref": "#/properties/canonical/properties/members/items"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "untried",
            "tried",
            "regular",
            "retired"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ]
        },
        "lastTouched": {
          "type": "string",
          "format": "date"
        },
        "nextAction": {
          "type": "string"
        },
        "relatedDocs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

Products

Objects you own, use, or want — gear, devices, vehicles. (Software lives in works per the schema.org class hierarchy, since SoftwareApplication is a CreativeWork.)

.product

product.add

scope · author effect · write audited v1

Add a product by providing canonical fields directly.

Primary write path. {product, created} envelope (family-consistent). No automatic dedup. Optional provenance? override for ingest pre-processors (when built).

REST · POST /products
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "brand": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "manufacturer": {
          "$ref": "#/properties/canonical/properties/brand"
        },
        "category": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "model": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "gtin": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "releaseDate": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "priceCurrency": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "researching",
            "owned",
            "sold",
            "returned"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "purchaseLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "vendor": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "product": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "const": "product"
        },
        "tier": {
          "type": "string",
          "enum": [
            "active",
            "reference"
          ]
        },
        "slug": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sameAs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "authority",
                  "reference",
                  "review",
                  "reservation",
                  "order",
                  "watch",
                  "listen",
                  "buy",
                  "social",
                  "website",
                  "article",
                  "video",
                  "edition",
                  "subtitle",
                  "other"
                ]
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          "default": []
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "provenance": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string"
            },
            "sourceUrl": {
              "type": "string",
              "format": "uri"
            },
            "capturedAt": {
              "type": "string",
              "format": "date-time"
            },
            "enrichedBy": {
              "type": "string"
            },
            "enrichedAt": {
              "type": "string",
              "format": "date-time"
            },
            "schemaVersion": {
              "type": "string"
            },
            "rawCapture": {},
            "template": {
              "type": "string"
            }
          },
          "required": [
            "source",
            "capturedAt",
            "schemaVersion"
          ],
          "additionalProperties": false
        },
        "canonical": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "brand": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "ref": {
                  "type": "string"
                },
                "matchConfidence": {
                  "type": "string",
                  "enum": [
                    "exact",
                    "fuzzy",
                    "unresolved",
                    "pending_review"
                  ]
                },
                "role": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "manufacturer": {
              "$ref": "#/properties/product/properties/canonical/properties/brand"
            },
            "category": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "model": {
              "type": "string"
            },
            "sku": {
              "type": "string"
            },
            "gtin": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri"
            },
            "releaseDate": {
              "type": "string",
              "format": "date"
            },
            "price": {
              "type": "number"
            },
            "priceCurrency": {
              "type": "string"
            },
            "keywords": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "overlay": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "wishlist",
                "researching",
                "owned",
                "sold",
                "returned"
              ]
            },
            "rating": {
              "type": "number",
              "minimum": 1,
              "maximum": 10
            },
            "favorite": {
              "type": "boolean"
            },
            "notes": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": []
            },
            "wishlist": {
              "type": "boolean"
            },
            "purchaseLog": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string",
                    "format": "date"
                  },
                  "price": {
                    "type": "number"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "vendor": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "date"
                ],
                "additionalProperties": false
              },
              "default": []
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "type",
        "tier",
        "createdAt",
        "updatedAt",
        "provenance",
        "canonical"
      ],
      "additionalProperties": false
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "product",
    "created"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

product.get

scope · reader effect · read v1

Retrieve a full product by ID, including canonical and overlay.

REST · GET /products/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "includeOverlay": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "product"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "brand": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "manufacturer": {
          "$ref": "#/properties/canonical/properties/brand"
        },
        "category": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "model": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "gtin": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "releaseDate": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "priceCurrency": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "researching",
            "owned",
            "sold",
            "returned"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "purchaseLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "vendor": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

product.log_purchase

scope · author effect · write audited v1

Append a purchase-log entry to a product overlay.

Append-only commerce log. Records date, price, currency, vendor.

REST · POST /products/:productId/purchases
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string"
    },
    "entry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "vendor": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "entry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "purchaseLogCount": {
      "type": "number"
    },
    "lastEntry": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "vendor": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        }
      },
      "required": [
        "date"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "purchaseLogCount",
    "lastEntry"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

product.search

scope · reader effect · read v1

Search products by name (trigram), brand, manufacturer, category, status.

Trigram match on canonical.name (products_title_trgm GIN index). Filters by brand substring, manufacturer substring, category containment, ownership status. Cursor pagination.

REST · GET /products/search
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "mode": {
      "type": "string",
      "enum": [
        "sql",
        "semantic",
        "hybrid"
      ],
      "default": "sql"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    },
    "category": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "maxItems": 10
    },
    "brand": {
      "type": "string"
    },
    "manufacturer": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "wishlist",
        "researching",
        "owned",
        "sold",
        "returned"
      ]
    },
    "minRating": {
      "type": "number",
      "minimum": 1,
      "maximum": 10
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "brand": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "model": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "priceCurrency": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "categories"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

product.update_canonical

scope · admin effect · write audited v1

Replace canonical fields on a product (admin-tier).

Whole-canonical replacement. The caller sends the complete ProductCanonicalSchema; the handler validates and writes. Identity fields (id, type, tier, provenance) are envelope-level and are not affected. Sets embedding_stale_at=now() so a future re-embedding pass picks up the change. Optional ifMatch on updatedAt enforces optimistic concurrency.

REST · PUT /products/:productId/canonical
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string"
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "brand": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "manufacturer": {
          "$ref": "#/properties/canonical/properties/brand"
        },
        "category": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "model": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "gtin": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "releaseDate": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "priceCurrency": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "ifMatch": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "productId",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "product"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "brand": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "manufacturer": {
          "$ref": "#/properties/canonical/properties/brand"
        },
        "category": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "model": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "gtin": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "releaseDate": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "priceCurrency": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "researching",
            "owned",
            "sold",
            "returned"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "purchaseLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "vendor": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

product.update_overlay

scope · author effect · write audited v1

Update overlay fields on a product (status, rating, purchaseLog, etc.).

REST · PATCH /products/:productId/overlay
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string"
    },
    "patch": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "researching",
            "owned",
            "sold",
            "returned"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "purchaseLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "vendor": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "productId",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "const": "product"
    },
    "tier": {
      "type": "string",
      "enum": [
        "active",
        "reference"
      ]
    },
    "slug": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "sameAs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          }
        },
        "required": [
          "source"
        ],
        "additionalProperties": false
      },
      "default": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "provenance": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time"
        },
        "enrichedBy": {
          "type": "string"
        },
        "enrichedAt": {
          "type": "string",
          "format": "date-time"
        },
        "schemaVersion": {
          "type": "string"
        },
        "rawCapture": {},
        "template": {
          "type": "string"
        }
      },
      "required": [
        "source",
        "capturedAt",
        "schemaVersion"
      ],
      "additionalProperties": false
    },
    "canonical": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "brand": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "ref": {
              "type": "string"
            },
            "matchConfidence": {
              "type": "string",
              "enum": [
                "exact",
                "fuzzy",
                "unresolved",
                "pending_review"
              ]
            },
            "role": {
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "manufacturer": {
          "$ref": "#/properties/canonical/properties/brand"
        },
        "category": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "model": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "gtin": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "releaseDate": {
          "type": "string",
          "format": "date"
        },
        "price": {
          "type": "number"
        },
        "priceCurrency": {
          "type": "string"
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "overlay": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "wishlist",
            "researching",
            "owned",
            "sold",
            "returned"
          ]
        },
        "rating": {
          "type": "number",
          "minimum": 1,
          "maximum": 10
        },
        "favorite": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "wishlist": {
          "type": "boolean"
        },
        "purchaseLog": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date"
              },
              "price": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "vendor": {
                "type": "string"
              },
              "notes": {
                "type": "string"
              }
            },
            "required": [
              "date"
            ],
            "additionalProperties": false
          },
          "default": []
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "type",
    "tier",
    "createdAt",
    "updatedAt",
    "provenance",
    "canonical"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

System

Cross-cutting operations — links, templates, admin, system introspection.

.admin

admin.source.list

scope · admin effect · read v1

List entries in the source registry, optionally filtered.

Returns every row in _system_sources (admin scope only). Optional filters: `kind` matches the ExternalRefKind exactly; `applicableType` returns rows whose applicableTypes array contains the given entity type. Rows with an empty applicableTypes are treated as "applies to any type" and are excluded by an applicableType filter — callers wanting "all sources that could plausibly apply" should call without the filter and post-filter on the client.

REST · GET /admin/sources
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "authority",
        "reference",
        "review",
        "reservation",
        "order",
        "watch",
        "listen",
        "buy",
        "social",
        "website",
        "article",
        "video",
        "edition",
        "subtitle",
        "other"
      ]
    },
    "applicableType": {
      "type": "string",
      "enum": [
        "recipe",
        "person",
        "organization",
        "place",
        "article",
        "book",
        "movie",
        "restaurant",
        "tv_series",
        "podcast",
        "video",
        "product",
        "event",
        "research_report",
        "music",
        "quote",
        "country",
        "state",
        "city",
        "sports_event",
        "music_event",
        "business_event",
        "software_application",
        "project"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "authority",
              "reference",
              "review",
              "reservation",
              "order",
              "watch",
              "listen",
              "buy",
              "social",
              "website",
              "article",
              "video",
              "edition",
              "subtitle",
              "other"
            ]
          },
          "applicableTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "recipe",
                "person",
                "organization",
                "place",
                "article",
                "book",
                "movie",
                "restaurant",
                "tv_series",
                "podcast",
                "video",
                "product",
                "event",
                "research_report",
                "music",
                "quote",
                "country",
                "state",
                "city",
                "sports_event",
                "music_event",
                "business_event",
                "software_application",
                "project"
              ]
            }
          },
          "urlTemplate": {
            "type": "string"
          },
          "resolverKind": {
            "type": "string",
            "enum": [
              "static",
              "ai",
              "mcp",
              "http"
            ]
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "source",
          "displayName",
          "kind",
          "applicableTypes",
          "resolverKind",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "sources"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

admin.source.upsert

scope · admin effect · write audited v1

Register or update an external link source in the source registry.

Creates a new _system_sources row keyed by `source` (e.g. "eater") or updates the existing row in place. Returns the persisted row with DB-assigned timestamps. Admin-only per Principle #5.

REST · POST /admin/sources
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "kind": {
      "type": "string",
      "enum": [
        "authority",
        "reference",
        "review",
        "reservation",
        "order",
        "watch",
        "listen",
        "buy",
        "social",
        "website",
        "article",
        "video",
        "edition",
        "subtitle",
        "other"
      ]
    },
    "applicableTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "recipe",
          "person",
          "organization",
          "place",
          "article",
          "book",
          "movie",
          "restaurant",
          "tv_series",
          "podcast",
          "video",
          "product",
          "event",
          "research_report",
          "music",
          "quote",
          "country",
          "state",
          "city",
          "sports_event",
          "music_event",
          "business_event",
          "software_application",
          "project"
        ]
      },
      "default": []
    },
    "urlTemplate": {
      "type": "string"
    },
    "resolverKind": {
      "type": "string",
      "enum": [
        "static",
        "ai",
        "mcp",
        "http"
      ],
      "default": "static"
    },
    "description": {
      "type": "string"
    }
  },
  "required": [
    "source",
    "displayName",
    "kind"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "authority",
        "reference",
        "review",
        "reservation",
        "order",
        "watch",
        "listen",
        "buy",
        "social",
        "website",
        "article",
        "video",
        "edition",
        "subtitle",
        "other"
      ]
    },
    "applicableTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "recipe",
          "person",
          "organization",
          "place",
          "article",
          "book",
          "movie",
          "restaurant",
          "tv_series",
          "podcast",
          "video",
          "product",
          "event",
          "research_report",
          "music",
          "quote",
          "country",
          "state",
          "city",
          "sports_event",
          "music_event",
          "business_event",
          "software_application",
          "project"
        ]
      }
    },
    "urlTemplate": {
      "type": "string"
    },
    "resolverKind": {
      "type": "string",
      "enum": [
        "static",
        "ai",
        "mcp",
        "http"
      ]
    },
    "description": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "source",
    "displayName",
    "kind",
    "applicableTypes",
    "resolverKind",
    "createdAt",
    "updatedAt"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.resolution

resolution.approve

scope · author effect · write audited v1

Human picks a candidate for a queued ref; updates the source entity.

Marks the queue row status='resolved', writes resolvedTo + resolvedBy + resolvedAt, then patches the source entity's canonical at sourceFieldPath to set { ref: resolvedTo, matchConfidence: 'exact' }. The fieldPath parser handles canonical.&lt;field&gt; and canonical.&lt;field&gt;[&lt;n&gt;] forms — all current usages. Author scope. Rate-limited to 30/min to prevent runaway scripts.

REST · POST /resolution/queue/:queueId/approve
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "queueId": {
      "type": "string"
    },
    "resolvedTo": {
      "type": "string"
    }
  },
  "required": [
    "queueId",
    "resolvedTo"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "queueRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "sourceEntityType": {
          "type": "string"
        },
        "sourceEntityId": {
          "type": "string"
        },
        "sourceFieldPath": {
          "type": "string"
        },
        "targetType": {
          "type": "string",
          "enum": [
            "person",
            "organization",
            "place",
            "country",
            "state",
            "city",
            "project"
          ]
        },
        "nameToResolve": {
          "type": "string"
        },
        "candidateMatches": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "score": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "name",
              "score"
            ],
            "additionalProperties": false
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "resolved",
            "skipped"
          ]
        },
        "resolvedTo": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "sourceEntityType",
        "sourceEntityId",
        "sourceFieldPath",
        "targetType",
        "nameToResolve",
        "candidateMatches",
        "status",
        "resolvedTo",
        "resolvedBy",
        "resolvedAt",
        "createdAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "queueRow"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

resolution.list

scope · reader effect · read v1

Browse the resolution queue.

Returns queue rows in created_at DESC order. Filter by status (default 'pending') and targetType. Cursor-paginated. The /console/resolve view reads this op to render pending decisions.

REST · GET /resolution/queue
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "resolved",
        "skipped"
      ],
      "default": "pending"
    },
    "targetType": {
      "type": "string",
      "enum": [
        "person",
        "organization",
        "place",
        "country",
        "state",
        "city",
        "project"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 50
    },
    "cursor": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sourceEntityType": {
            "type": "string"
          },
          "sourceEntityId": {
            "type": "string"
          },
          "sourceFieldPath": {
            "type": "string"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "person",
              "organization",
              "place",
              "country",
              "state",
              "city",
              "project"
            ]
          },
          "nameToResolve": {
            "type": "string"
          },
          "candidateMatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "score": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "name",
                "score"
              ],
              "additionalProperties": false
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "resolved",
              "skipped"
            ]
          },
          "resolvedTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolvedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolvedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "sourceEntityType",
          "sourceEntityId",
          "sourceFieldPath",
          "targetType",
          "nameToResolve",
          "candidateMatches",
          "status",
          "resolvedTo",
          "resolvedBy",
          "resolvedAt",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

resolution.merge_stub

scope · admin effect · destroy audited v1

Collapse two reference-tier stubs of the same entity into one.

When the resolver creates two stubs for what turns out to be the same real-world entity (e.g. "Diana Kennedy" from a book ingest + "Diana Kennedy" from a recipe ingest), this op repoints every EntityRef from the loser to the winner, updates any resolution-queue rows that named the loser as their target, then deletes the loser row. Scope is admin — stub deletion is destructive even though the side effects are recoverable (refs can be re-resolved). Both inputs MUST be tier='reference'. Merging active entities is intentionally out of scope; that's a per-type operation with overlay/sameAs reconciliation beyond this op's responsibility. Required to unblock migration 0011_resolver_stubs_unique.sql when existing duplicate-name stubs (Diana Kennedy ×2, The New York Times ×2, Mexico City ×2) block the unique index creation.

REST · POST /resolution/merge_stub
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "targetType": {
      "type": "string",
      "enum": [
        "person",
        "organization",
        "place",
        "country",
        "state",
        "city",
        "project"
      ]
    },
    "loserId": {
      "type": "string"
    },
    "winnerId": {
      "type": "string"
    }
  },
  "required": [
    "targetType",
    "loserId",
    "winnerId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "loserId": {
      "type": "string"
    },
    "winnerId": {
      "type": "string"
    },
    "refsRepointed": {
      "type": "integer"
    },
    "queueRowsRepointed": {
      "type": "integer"
    },
    "loserDeleted": {
      "type": "boolean"
    }
  },
  "required": [
    "loserId",
    "winnerId",
    "refsRepointed",
    "queueRowsRepointed",
    "loserDeleted"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

resolution.resolve_ref

scope · author effect · write audited v1

Resolve a verbatim name to a typed entity ref (exact / queue / stub).

Tiered resolver. Exact case-insensitive match → link with matchConfidence='exact'. Fuzzy match above threshold → queue for human review (matchConfidence='pending_review'). Miss → create a reference-tier stub and link to it. Called by every ingest path after building canonical but before persisting. The source* fields are required when fuzzy candidates trigger queue insertion — they tell the queue which entity/field needs human approval. Pass `source.entityId` using a preassigned ULID before calling the entity's .add op, so the queue row points at a valid target by the time anyone reviews it. Author scope: agents acting on KB's behalf call this routinely during ingest. Stubs created here are reference-tier (Principle #4) — low-stakes, fillable later.

REST · POST /resolution/resolve
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "targetType": {
      "type": "string",
      "enum": [
        "person",
        "organization",
        "place",
        "country",
        "state",
        "city",
        "project"
      ]
    },
    "source": {
      "type": "object",
      "properties": {
        "entityType": {
          "type": "string"
        },
        "entityId": {
          "type": "string"
        },
        "fieldPath": {
          "type": "string"
        }
      },
      "required": [
        "entityType",
        "entityId",
        "fieldPath"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "name",
    "targetType"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "ref": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "ref": {
          "type": "string"
        },
        "matchConfidence": {
          "type": "string",
          "enum": [
            "exact",
            "fuzzy",
            "unresolved",
            "pending_review"
          ]
        },
        "role": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "action": {
      "type": "string",
      "enum": [
        "exact",
        "stub_created",
        "queued"
      ]
    }
  },
  "required": [
    "ref",
    "action"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

resolution.skip

scope · author effect · write audited v1

Dismiss a queue row without picking a candidate.

Marks the queue row status='skipped'. Does NOT touch the source entity — the EntityRef remains pending_review on the source. Use when none of the candidates fit and you don't want to force a stub from this UI flow.

REST · POST /resolution/queue/:queueId/skip
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "queueId": {
      "type": "string"
    }
  },
  "required": [
    "queueId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "queueRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "sourceEntityType": {
          "type": "string"
        },
        "sourceEntityId": {
          "type": "string"
        },
        "sourceFieldPath": {
          "type": "string"
        },
        "targetType": {
          "type": "string",
          "enum": [
            "person",
            "organization",
            "place",
            "country",
            "state",
            "city",
            "project"
          ]
        },
        "nameToResolve": {
          "type": "string"
        },
        "candidateMatches": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "score": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "name",
              "score"
            ],
            "additionalProperties": false
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "resolved",
            "skipped"
          ]
        },
        "resolvedTo": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolvedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "sourceEntityType",
        "sourceEntityId",
        "sourceFieldPath",
        "targetType",
        "nameToResolve",
        "candidateMatches",
        "status",
        "resolvedTo",
        "resolvedBy",
        "resolvedAt",
        "createdAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "queueRow"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.schema

schema.get

scope · reader effect · read v1

Fetch the JSON Schema for a single entity type.

Returns the JSON Schema (materialized from Zod on demand) plus metadata. The optional `version` input is reserved for future schema versioning; in this milestone only v1 of each type exists. Reader-scope so agents can introspect the exact shape before producing entities.

REST · GET /schemas/:type
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "type"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "deprecated",
        "archived"
      ]
    },
    "jsonSchema": {},
    "description": {
      "type": "string"
    }
  },
  "required": [
    "type",
    "version",
    "status"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

schema.list

scope · reader effect · read v1

List every entity schema Verdad knows about.

Returns one row per registered schema (type + version + status). Use schema.get to fetch the actual JSON Schema for any entry. Optional `status` filter narrows to active / deprecated / archived. Reader-scope so agents acting as authors can introspect what shape to produce.

REST · GET /schemas
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "active",
        "deprecated",
        "archived"
      ]
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "schemas": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "deprecated",
              "archived"
            ]
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "version",
          "status"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "schemas"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.system

system.counts

scope · reader effect · read v1

Per-type row counts across all entity tables.

Returns the total number of rows in each of the 16 entity tables. Cheap — runs SELECT count(*) on each table in parallel. Used by the console nav header to surface live counts without fanning out to 16 separate <type>.search calls per page navigation.

REST · GET /system/counts
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {},
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "recipe": {
      "type": "integer",
      "minimum": 0
    },
    "article": {
      "type": "integer",
      "minimum": 0
    },
    "book": {
      "type": "integer",
      "minimum": 0
    },
    "person": {
      "type": "integer",
      "minimum": 0
    },
    "organization": {
      "type": "integer",
      "minimum": 0
    },
    "place": {
      "type": "integer",
      "minimum": 0
    },
    "movie": {
      "type": "integer",
      "minimum": 0
    },
    "restaurant": {
      "type": "integer",
      "minimum": 0
    },
    "tv_series": {
      "type": "integer",
      "minimum": 0
    },
    "podcast": {
      "type": "integer",
      "minimum": 0
    },
    "video": {
      "type": "integer",
      "minimum": 0
    },
    "product": {
      "type": "integer",
      "minimum": 0
    },
    "event": {
      "type": "integer",
      "minimum": 0
    },
    "research_report": {
      "type": "integer",
      "minimum": 0
    },
    "music": {
      "type": "integer",
      "minimum": 0
    },
    "quote": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "recipe",
    "article",
    "book",
    "person",
    "organization",
    "place",
    "movie",
    "restaurant",
    "tv_series",
    "podcast",
    "video",
    "product",
    "event",
    "research_report",
    "music",
    "quote"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

.template

template.apply

scope · author effect · write audited v1

Create a new entity by merging overrides onto a template's partial.

Deep-merges template.partial.canonical with overrides.canonical (and overlay, tags). Objects merge recursively; arrays REPLACE wholesale (overrides.cuisine = ['mexican'] replaces the template's cuisine list entirely — pass a complete array or omit). The merged canonical is validated against the entity's <Type>CanonicalSchema; on failure returns `invalid_input` with the Zod issues. On success, inserts a new entity row with `provenance.template = <templateId>` and bumps the template's `useCount` + `lastUsedAt` in the same transaction. Returns the created entity's id + provenance; use the entity's `.get` to fetch the full envelope.

REST · POST /templates/:templateId/apply
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "overrides": {
      "type": "object",
      "properties": {
        "canonical": {},
        "overlay": {},
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false,
      "default": {}
    }
  },
  "required": [
    "templateId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "entityType": {
      "type": "string",
      "enum": [
        "recipe",
        "person",
        "organization",
        "place",
        "article",
        "book",
        "movie",
        "restaurant",
        "tv_series",
        "podcast",
        "video",
        "product",
        "event",
        "research_report",
        "music",
        "quote",
        "country",
        "state",
        "city",
        "sports_event",
        "music_event",
        "business_event",
        "software_application",
        "project"
      ]
    },
    "entityId": {
      "type": "string"
    },
    "templateId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "provenance": {}
  },
  "required": [
    "entityType",
    "entityId",
    "templateId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

template.create

scope · author effect · write audited v1

Create a new template. Errors with `conflict` if the id already exists.

Creates a template with a caller-supplied slug id. The id's entity-type prefix (e.g. `recipe.X`) must match the schemaId's entity type (e.g. `recipe@v1`). Errors on id conflict — use template.update for partial patches.

REST · POST /templates
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "schemaId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "partial": {
      "type": "object",
      "properties": {
        "canonical": {},
        "overlay": {},
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "schemaId",
    "name",
    "partial"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "schemaId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "partial": {
      "type": "object",
      "properties": {
        "canonical": {},
        "overlay": {},
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "useCount": {
      "type": "integer"
    },
    "lastUsedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "schemaId",
    "name",
    "partial",
    "useCount",
    "lastUsedAt",
    "createdAt",
    "createdBy"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

template.delete

scope · author effect · destroy audited v1

Delete a template by id. Idempotent; returns `{deleted:false}` if missing.

REST · DELETE /templates/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "deleted": {
      "type": "boolean"
    }
  },
  "required": [
    "deleted"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

template.get

scope · author effect · read v1

Get a single template by id.

REST · GET /templates/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "schemaId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "partial": {
      "type": "object",
      "properties": {
        "canonical": {},
        "overlay": {},
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "useCount": {
      "type": "integer"
    },
    "lastUsedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "schemaId",
    "name",
    "partial",
    "useCount",
    "lastUsedAt",
    "createdAt",
    "createdBy"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

template.list

scope · author effect · read v1

List templates; filter by entityType and/or schemaId.

Lists templates ordered by `lastUsedAt DESC NULLS LAST, createdAt DESC, id DESC` — most-recently-applied first, with never-used templates falling to creation order. Cursor-based pagination via the shared paginate helper. Returns concise hits; use template.get for the full `partial` payload.

REST · GET /templates
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "entityType": {
      "type": "string",
      "enum": [
        "recipe",
        "person",
        "organization",
        "place",
        "article",
        "book",
        "movie",
        "restaurant",
        "tv_series",
        "podcast",
        "video",
        "product",
        "event",
        "research_report",
        "music",
        "quote",
        "country",
        "state",
        "city",
        "sports_event",
        "music_event",
        "business_event",
        "software_application",
        "project"
      ]
    },
    "schemaId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 20
    },
    "cursor": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
          },
          "schemaId": {
            "type": "string",
            "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "useCount": {
            "type": "integer"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "schemaId",
          "name",
          "useCount",
          "lastUsedAt"
        ],
        "additionalProperties": false
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "totalCount": {
      "type": "integer"
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

template.update

scope · author effect · write audited v1

Patch an existing template. Errors with `not_found` if missing.

Shallow-merges the patch over the row's fields. `id` and `schemaId` are immutable post-create — passing them in the patch is rejected at the input layer.

REST · PATCH /templates/:id
Input schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "patch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "description": {
          "type": "string",
          "maxLength": 500
        },
        "partial": {
          "type": "object",
          "properties": {
            "canonical": {},
            "overlay": {},
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 10
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id",
    "patch"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Output schema (JSON Schema)
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)\\.[a-z][a-z0-9-]*$"
    },
    "schemaId": {
      "type": "string",
      "pattern": "^(recipe|person|entity|place|article)@v\\d+$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "partial": {
      "type": "object",
      "properties": {
        "canonical": {},
        "overlay": {},
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "useCount": {
      "type": "integer"
    },
    "lastUsedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "schemaId",
    "name",
    "partial",
    "useCount",
    "lastUsedAt",
    "createdAt",
    "createdBy"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}