{
  "openapi": "3.1.0",
  "info": {
    "title": "bknd API",
    "version": "0.14.0"
  },
  "paths": {
    "/api/data": {
      "get": {
        "responses": {},
        "operationId": "getApiData",
        "summary": "Retrieve data configuration",
        "tags": [
          "data"
        ]
      }
    },
    "/api/data/sync": {
      "get": {
        "responses": {},
        "operationId": "getApiDataSync",
        "summary": "Sync database schema",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "drop",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      }
    },
    "/api/data/schema.json": {
      "get": {
        "responses": {},
        "operationId": "getApiDataSchema.json",
        "summary": "Retrieve data schema",
        "tags": [
          "data"
        ]
      }
    },
    "/api/data/schemas/{entity}/{context}": {
      "get": {
        "responses": {},
        "operationId": "getApiDataSchemasByEntityByContext",
        "summary": "Retrieve entity schema",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "context",
            "in": "path",
            "schema": {
              "enum": [
                "create",
                "update"
              ],
              "default": "create",
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/data/entity/{entity}/fn/count": {
      "post": {
        "responses": {},
        "operationId": "postApiDataEntityByEntityFnCount",
        "summary": "Count entities",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "default": {},
                "examples": [
                  {
                    "attribute": {
                      "$eq": 1
                    }
                  }
                ],
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "properties": {}
                  }
                ]
              },
              "example": {
                "attribute": {
                  "$eq": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/data/entity/{entity}/fn/exists": {
      "post": {
        "responses": {},
        "operationId": "postApiDataEntityByEntityFnExists",
        "summary": "Check if entity exists",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "default": {},
                "examples": [
                  {
                    "attribute": {
                      "$eq": 1
                    }
                  }
                ],
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "properties": {}
                  }
                ]
              },
              "example": {
                "attribute": {
                  "$eq": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/data/entity/{entity}": {
      "get": {
        "responses": {},
        "operationId": "getApiDataEntityByEntity",
        "summary": "Read many",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "type": "number"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "default": "id",
              "type": "string"
            }
          },
          {
            "name": "select",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "join",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "data"
        ]
      },
      "post": {
        "responses": {},
        "operationId": "postApiDataEntityByEntity",
        "summary": "Insert one or many",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {}
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "patch": {
        "responses": {},
        "operationId": "patchApiDataEntityByEntity",
        "summary": "Update many",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "update": {
                    "type": "object",
                    "properties": {}
                  },
                  "where": {
                    "default": {},
                    "examples": [
                      {
                        "attribute": {
                          "$eq": 1
                        }
                      }
                    ],
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {}
                      }
                    ]
                  }
                },
                "required": [
                  "update"
                ]
              },
              "example": {
                "update": {},
                "where": {}
              }
            }
          }
        }
      },
      "delete": {
        "responses": {},
        "operationId": "deleteApiDataEntityByEntity",
        "summary": "Delete many",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "default": {},
                "examples": [
                  {
                    "attribute": {
                      "$eq": 1
                    }
                  }
                ],
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "properties": {}
                  }
                ]
              },
              "example": {
                "attribute": {
                  "$eq": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/data/entity/{entity}/{id}": {
      "get": {
        "responses": {},
        "operationId": "getApiDataEntityByEntityById",
        "summary": "Read one",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "type": "number"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "default": "id",
              "type": "string"
            }
          },
          {
            "name": "select",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        ],
        "tags": [
          "data"
        ]
      },
      "patch": {
        "responses": {},
        "operationId": "patchApiDataEntityByEntityById",
        "summary": "Update one",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        }
      },
      "delete": {
        "responses": {},
        "operationId": "deleteApiDataEntityByEntityById",
        "summary": "Delete one",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        ]
      }
    },
    "/api/data/entity/{entity}/{id}/{reference}": {
      "get": {
        "responses": {},
        "operationId": "getApiDataEntityByEntityByIdByReference",
        "summary": "Read many by reference",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "default": 10,
              "type": "number"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "default": 0,
              "type": "number"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "default": "id",
              "type": "string"
            }
          },
          {
            "name": "where",
            "in": "query",
            "schema": {
              "default": {},
              "examples": [
                {
                  "attribute": {
                    "$eq": 1
                  }
                }
              ],
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {}
                }
              ]
            }
          },
          {
            "name": "select",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "join",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "data"
        ]
      }
    },
    "/api/data/entity/{entity}/query": {
      "post": {
        "responses": {},
        "operationId": "postApiDataEntityByEntityQuery",
        "summary": "Query entities",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 10,
                    "type": "number"
                  },
                  "offset": {
                    "default": 0,
                    "type": "number"
                  },
                  "sort": {
                    "default": "id",
                    "type": "string"
                  },
                  "where": {
                    "default": {},
                    "examples": [
                      {
                        "attribute": {
                          "$eq": 1
                        }
                      }
                    ],
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {}
                      }
                    ]
                  },
                  "select": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "join": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "with": {
                    "type": "object",
                    "properties": {}
                  }
                }
              },
              "example": {
                "limit": 10,
                "offset": 0,
                "sort": "id",
                "where": {},
                "select": [],
                "join": [],
                "with": {}
              }
            }
          }
        },
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/data/info/{entity}": {
      "get": {
        "responses": {},
        "operationId": "getApiDataInfoByEntity",
        "summary": "Retrieve entity info",
        "tags": [
          "data"
        ],
        "parameters": [
          {
            "name": "entity",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/system/config/raw": {
      "get": {
        "responses": {},
        "operationId": "getApiSystemConfigRaw",
        "summary": "Get the raw config",
        "tags": [
          "system"
        ]
      }
    },
    "/api/system/config/{module}": {
      "get": {
        "responses": {},
        "operationId": "getApiSystemConfigByModule",
        "summary": "Get the config for a module",
        "tags": [
          "system"
        ],
        "parameters": [
          {
            "name": "module",
            "in": "path",
            "schema": {
              "enum": [
                "server",
                "data",
                "auth",
                "media",
                "flows"
              ],
              "type": "string"
            }
          },
          {
            "name": "secrets",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      }
    },
    "/api/system/schema/{module}": {
      "get": {
        "responses": {},
        "operationId": "getApiSystemSchemaByModule",
        "summary": "Get the schema for a module",
        "tags": [
          "system"
        ],
        "parameters": [
          {
            "name": "config",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "secrets",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "fresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      }
    },
    "/api/system/build": {
      "post": {
        "responses": {},
        "operationId": "postApiSystemBuild",
        "summary": "Build the app",
        "tags": [
          "system"
        ],
        "parameters": [
          {
            "name": "sync",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "fetch",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ]
      }
    },
    "/api/system/ping": {
      "get": {
        "responses": {},
        "operationId": "getApiSystemPing",
        "summary": "Ping the server",
        "tags": [
          "system"
        ]
      }
    },
    "/api/system/info": {
      "get": {
        "responses": {},
        "operationId": "getApiSystemInfo",
        "summary": "Get the server info",
        "tags": [
          "system"
        ]
      }
    }
  }
}