{
  "openapi": "3.0.3",
  "info": {
    "title": "Bento Sync API",
    "version": "1.0.0",
    "description": "Retrieve personal saves, collections, saved pools and followed tags from Bento Sync. Includes owner-private following-feed snapshots, record operations and incremental sync. PocketBase collection validation and access rules are authoritative. Examples use synthetic data."
  },
  "servers": [
    {
      "url": "https://api.bentoapp.net"
    }
  ],
  "components": {
    "securitySchemes": {
      "BentoSession": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Bento user session token; send the raw token without a Bearer prefix. Obtain it via auth-with-identity. Refresh while still valid using users/auth-refresh."
      }
    }
  },
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Service status",
        "description": "Checks whether the API responds. This does not confirm authentication or a successful device sync.",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "code": 200,
                  "message": "API is healthy.",
                  "data": {}
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/collections/users/auth-refresh": {
      "post": {
        "operationId": "refresh",
        "summary": "Refresh session",
        "description": "Returns a new token and account record when the current token is valid. Expired sessions require a new login.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "token",
                    "record"
                  ],
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "record": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "user": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "token": "[redacted]",
                  "record": {
                    "id": "exampleuser0001",
                    "handle": "demo",
                    "verified": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/bento/sync-manifest": {
      "get": {
        "operationId": "manifest",
        "summary": "Sync manifest",
        "description": "Returns version and domains. Treat domain tokens as opaque comparison values, not cursors. Unchanged domains need not be fetched again.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "domains"
                  ],
                  "properties": {
                    "version": {
                      "type": "integer",
                      "enum": [
                        1
                      ]
                    },
                    "domains": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "version": 1,
                  "domains": {
                    "accounts": "delta:12",
                    "saves": "delta:42",
                    "collections": "<hash>",
                    "pools": "delta:0",
                    "follows": "delta:8",
                    "blacklists": "delta:0",
                    "history": "delta:11",
                    "settings": "delta:9",
                    "shared": "<hash>",
                    "watch": "delta:0",
                    "drafts": "delta:0"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/bento/sync-changes/{collection}": {
      "get": {
        "operationId": "changes",
        "summary": "Read changes",
        "description": "Owner-private changes after after (default 0). limit: 1–500, default 100. Keep the returned until value for subsequent pages. Persist the cursor together with the applied changes.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "cursor",
                    "until",
                    "hasMore",
                    "changes"
                  ],
                  "properties": {
                    "version": {
                      "type": "integer",
                      "enum": [
                        1
                      ]
                    },
                    "cursor": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "until": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "changes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "seq",
                          "id",
                          "key",
                          "deleted",
                          "record"
                        ],
                        "properties": {
                          "seq": {
                            "type": "integer",
                            "format": "int64"
                          },
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "deleted": {
                            "type": "boolean"
                          },
                          "record": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "user": {
                                "type": "string"
                              }
                            },
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "version": 1,
                  "cursor": 42,
                  "until": 42,
                  "hasMore": false,
                  "changes": [
                    {
                      "seq": 42,
                      "id": "example00000001",
                      "key": "example.org#123",
                      "deleted": false,
                      "record": {
                        "id": "example00000001",
                        "user": "exampleuser0001",
                        "post_key": "example.org#123",
                        "host": "example.org",
                        "post_id": "123",
                        "rating": "s",
                        "tags": [
                          "landscape"
                        ],
                        "payload": {
                          "id": 123
                        },
                        "thumb_url": "https://example.org/thumb/123.jpg",
                        "file_url": "https://example.org/files/123.jpg"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ]
      }
    },
    "/api/collections/{collection}/records": {
      "get": {
        "operationId": "list",
        "summary": "List records",
        "description": "Returns page, perPage, totalItems, totalPages and items. The explorer filters by your account ID because ordinary lists may include other users’ shared data. Access rules can return empty items even when records exist.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "perPage",
                    "totalItems",
                    "totalPages",
                    "items"
                  ],
                  "properties": {
                    "page": {
                      "type": "integer"
                    },
                    "perPage": {
                      "type": "integer"
                    },
                    "totalItems": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "user": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "page": 1,
                  "perPage": 20,
                  "totalItems": 1,
                  "totalPages": 1,
                  "items": [
                    {
                      "id": "example00000001",
                      "user": "exampleuser0001",
                      "post_key": "example.org#123",
                      "host": "example.org",
                      "post_id": "123",
                      "rating": "s",
                      "tags": [
                        "landscape"
                      ],
                      "payload": {
                        "id": 123
                      },
                      "thumb_url": "https://example.org/thumb/123.jpg",
                      "file_url": "https://example.org/files/123.jpg"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "For personal sync use user = \"<record.id>\". Other records may otherwise be visible according to privacy rules.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "create",
        "summary": "Create record",
        "description": "Creates your own record. The explorer sets user to your account ID. Required fields and write permissions depend on the collection. Clients cannot create watch_events.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "example00000001",
                  "user": "exampleuser0001",
                  "post_key": "example.org#123",
                  "host": "example.org",
                  "post_id": "123",
                  "rating": "s",
                  "tags": [
                    "landscape"
                  ],
                  "payload": {
                    "id": 123
                  },
                  "thumb_url": "https://example.org/thumb/123.jpg",
                  "file_url": "https://example.org/files/123.jpg"
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "user": "<account-id>",
                "post_key": "example.org#123",
                "host": "example.org",
                "post_id": "123",
                "rating": "s",
                "tags": [
                  "landscape"
                ],
                "payload": {
                  "id": 123
                }
              }
            }
          }
        }
      }
    },
    "/api/collections/{collection}/records/{recordID}": {
      "get": {
        "operationId": "record",
        "summary": "Read one record",
        "description": "Returns the record directly, without an items envelope. recordID is the PocketBase ID, not post_id or post_key. Collection access rules still apply.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "example00000001",
                  "user": "exampleuser0001",
                  "post_key": "example.org#123",
                  "host": "example.org",
                  "post_id": "123",
                  "rating": "s",
                  "tags": [
                    "landscape"
                  ],
                  "payload": {
                    "id": 123
                  },
                  "thumb_url": "https://example.org/thumb/123.jpg",
                  "file_url": "https://example.org/files/123.jpg"
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          },
          {
            "name": "recordID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{15}$"
            }
          }
        ]
      },
      "patch": {
        "operationId": "update",
        "summary": "Update record",
        "description": "Updates only the submitted fields of a record you own. Ownership and identity remain fixed. Omitting a JSON field is different from clearing its contents.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": "example00000001",
                  "user": "exampleuser0001",
                  "post_key": "example.org#123",
                  "host": "example.org",
                  "post_id": "123",
                  "rating": "s",
                  "tags": [
                    "landscape",
                    "favorite"
                  ],
                  "payload": {
                    "id": 123
                  },
                  "thumb_url": "https://example.org/thumb/123.jpg",
                  "file_url": "https://example.org/files/123.jpg"
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          },
          {
            "name": "recordID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{15}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "tags": [
                  "landscape",
                  "favorite"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete",
        "summary": "Delete record",
        "description": "Deletes a record you own. Success is HTTP 204 with no response body. Deletions enter the change journal and reach your other devices.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted; no response body"
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "saves",
                "booru_accounts",
                "post_collections",
                "saved_pools",
                "tag_follows",
                "blacklist_entries",
                "recently_viewed",
                "app_settings",
                "watch_events",
                "upload_drafts"
              ]
            }
          },
          {
            "name": "recordID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{15}$"
            }
          }
        ]
      }
    },
    "/api/bento/saves-batch": {
      "post": {
        "operationId": "savesBatch",
        "summary": "Saves batch",
        "description": "1–500 operations per transaction; maximum request size 4 MiB. Keys must be unique within the packet. ensure creates missing saves; upsert updates; verify reads the ID; delete removes. The server sets the owner. Bento sends at most 3 MiB per packet.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "results"
                  ],
                  "properties": {
                    "version": {
                      "type": "integer",
                      "enum": [
                        1
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string",
                            "nullable": true
                          },
                          "status": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "version": 1,
                  "results": [
                    {
                      "key": "example.org#123",
                      "id": "example00000001",
                      "status": 200
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "operations"
                ],
                "properties": {
                  "operations": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "required": [
                        "action",
                        "key"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "enum": [
                            "ensure",
                            "upsert",
                            "verify",
                            "delete"
                          ]
                        },
                        "key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "body": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Required for ensure/upsert; accepted fields: host, post_id, payload, rating, tags, thumb_url, file_url, source_url. Owner is set by server."
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "operations": [
                  {
                    "action": "ensure",
                    "key": "example.org#123",
                    "body": {
                      "host": "example.org",
                      "post_id": "123",
                      "rating": "s",
                      "tags": [
                        "landscape"
                      ],
                      "payload": {
                        "id": 123
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/bento/pools": {
      "post": {
        "operationId": "pools",
        "summary": "Read pool cache",
        "description": "Reads cached metadata for an enabled booru account you own. Use extra.client_id from booru_accounts and optionally up to 200 positive pool_ids. Requires server background checks. Does not query the booru. ready=false means the cache is unavailable or stale. revision is Unix time in milliseconds.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ready",
                    "latest",
                    "items"
                  ],
                  "properties": {
                    "ready": {
                      "type": "boolean"
                    },
                    "latest": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pool": {
                            "type": "object"
                          },
                          "revision": {
                            "type": "number",
                            "description": "Unix time in milliseconds"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "ready": false,
                  "latest": [],
                  "items": []
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "pool_ids": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              },
              "example": {
                "client_id": "<booru-client-id>",
                "pool_ids": [
                  123
                ]
              }
            }
          }
        }
      }
    },
    "/api/bento/auth-with-identity": {
      "post": {
        "operationId": "login",
        "summary": "Bento login by email or username",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "identity",
                  "password"
                ],
                "properties": {
                  "identity": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password"
                  }
                }
              },
              "example": {
                "identity": "demo",
                "password": "YOUR_PASSWORD"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authenticated session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "token",
                    "record"
                  ],
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "record": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "user": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid credentials, or rate-limited login",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/batch": {
      "post": {
        "operationId": "recordBatch",
        "summary": "Transactional PocketBase record batch",
        "description": "Configured maximum at least 50 in the current migration. Client packets should contain at most 50 operations. Collection access rules apply.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requests"
                ],
                "properties": {
                  "requests": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "required": [
                        "method",
                        "url"
                      ],
                      "properties": {
                        "method": {
                          "type": "string",
                          "enum": [
                            "POST",
                            "PATCH",
                            "DELETE",
                            "PUT"
                          ]
                        },
                        "url": {
                          "type": "string"
                        },
                        "body": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-operation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "integer"
                      },
                      "body": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Batch rejected/rolled back",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/collections/following_snapshots/records": {
      "get": {
        "operationId": "followingFeed",
        "summary": "Read following feed",
        "description": "Reads temporary post metadata from the server’s following feed. Only your snapshots are visible. Enable background checks for the server to update them. payload keeps the source booru’s JSON format; fetched_at is the fetch time. No media files.",
        "security": [
          {
            "BentoSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "page",
                    "perPage",
                    "totalItems",
                    "totalPages",
                    "items"
                  ],
                  "properties": {
                    "page": {
                      "type": "integer"
                    },
                    "perPage": {
                      "type": "integer"
                    },
                    "totalItems": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "user": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "page": 1,
                  "perPage": 20,
                  "totalItems": 1,
                  "totalPages": 1,
                  "items": [
                    {
                      "id": "example00000002",
                      "user": "exampleuser0001",
                      "client_id": "<booru-client-id>",
                      "tag": "*",
                      "host": "example.org",
                      "server_type": "danbooru",
                      "payload": [
                        {
                          "id": 123,
                          "tag_string": "landscape"
                        }
                      ],
                      "fetched_at": "2026-10-05 00:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "501": {
            "description": "Error; inspect HTTP status and response. Retry-After may accompany 429.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object"
                    },
                    "errorKey": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "description": "For personal sync use user = \"<record.id>\". Other records may otherwise be visible according to privacy rules.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  }
}
