2022-02-16 17:42:50 +01:00
{
"openapi" : "3.0.0" ,
"info" : {
"title" : "Budibase API" ,
"description" : "The public API for Budibase apps and its services." ,
"version" : "1.0.0"
} ,
"servers" : [
{
2022-02-17 19:58:09 +01:00
"url" : "http://budibase.app/api/public/v1" ,
2022-02-16 17:42:50 +01:00
"description" : "Budibase Cloud API"
2022-02-17 13:40:08 +01:00
} ,
{
2022-02-17 19:58:09 +01:00
"url" : "{protocol}://{hostname}:10000/api/public/v1" ,
2022-02-17 13:40:08 +01:00
"description" : "Budibase self hosted API"
2022-02-16 17:42:50 +01:00
}
] ,
2022-02-17 19:58:09 +01:00
"components" : {
2022-02-17 20:55:37 +01:00
"parameters" : {
"tableId" : {
"in" : "path" ,
"name" : "tableId" ,
"required" : true ,
2022-02-18 16:47:15 +01:00
"description" : "The ID of the table which this request is targeting." ,
"schema" : {
"type" : "string"
}
} ,
"rowId" : {
"in" : "path" ,
"name" : "rowId" ,
"required" : true ,
"description" : "The ID of the row which this request is targeting." ,
2022-02-17 20:55:37 +01:00
"schema" : {
"type" : "string"
}
2022-02-18 18:44:08 +01:00
} ,
"appId" : {
"in" : "header" ,
2022-02-18 18:54:03 +01:00
"name" : "x-budibase-app-id" ,
2022-02-18 18:44:08 +01:00
"required" : true ,
"description" : "The ID of the app which this request is targeting." ,
"schema" : {
"type" : "string"
}
2022-02-17 20:55:37 +01:00
}
} ,
2022-02-17 19:58:09 +01:00
"examples" : {
"table" : {
"value" : {
"_id" : "ta_5b1649e42a5b41dea4ef7742a36a7a70" ,
"name" : "People" ,
"schema" : {
"name" : {
"type" : "string" ,
"name" : "name"
} ,
"age" : {
"type" : "number" ,
"name" : "age"
} ,
"relationship" : {
"type" : "link" ,
"name" : "relationship" ,
"tableId" : "ta_..." ,
"fieldName" : "relatedColumn" ,
"relationshipType" : "many-to-many"
}
}
}
2022-02-18 16:47:15 +01:00
} ,
2022-02-18 18:44:08 +01:00
"tables" : {
"value" : [
{
"_id" : "ta_5b1649e42a5b41dea4ef7742a36a7a70" ,
"name" : "People" ,
"schema" : {
"name" : {
"type" : "string" ,
"name" : "name"
} ,
"age" : {
"type" : "number" ,
"name" : "age"
} ,
"relationship" : {
"type" : "link" ,
"name" : "relationship" ,
"tableId" : "ta_..." ,
"fieldName" : "relatedColumn" ,
"relationshipType" : "many-to-many"
}
}
}
]
} ,
"inputRow" : {
"value" : {
"_id" : "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4" ,
"type" : "row" ,
"tableId" : "ta_5b1649e42a5b41dea4ef7742a36a7a70" ,
"name" : "Mike" ,
"age" : 30 ,
"relationship" : [
"ro_ta_..."
]
}
} ,
2022-02-18 16:47:15 +01:00
"row" : {
"value" : {
"_id" : "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4" ,
"type" : "row" ,
"tableId" : "ta_5b1649e42a5b41dea4ef7742a36a7a70" ,
"name" : "Mike" ,
"age" : 30 ,
"relationship" : [
{
"primaryDisplay" : "Joe" ,
"_id" : "ro_ta_..."
}
]
}
} ,
"search" : {
"value" : {
"rows" : [
{
"_id" : "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4" ,
"type" : "row" ,
"tableId" : "ta_5b1649e42a5b41dea4ef7742a36a7a70" ,
"name" : "Mike" ,
"age" : 30 ,
"relationship" : [
{
"primaryDisplay" : "Joe" ,
"_id" : "ro_ta_..."
}
]
}
] ,
"hasNextPage" : true ,
"bookmark" : 10
}
}
} ,
"securitySchemes" : {
"ApiKeyAuth" : {
"type" : "apiKey" ,
"in" : "header" ,
"name" : "x-budibase-api-key" ,
"description" : "Your individual API key, this will provide access based on the configured RBAC settings of your user."
2022-02-17 19:58:09 +01:00
}
2022-02-18 18:44:08 +01:00
} ,
"schemas" : {
"row" : {
"description" : "The row to be created/updated, based on the table schema." ,
"type" : "object" ,
"additionalProperties" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "object"
} ,
{
"type" : "integer"
} ,
{
"type" : "array"
} ,
{
"type" : "boolean"
}
]
}
2022-02-18 19:06:58 +01:00
} ,
"table" : {
"description" : "The table to be created/updated." ,
"type" : "object" ,
"properties" : {
"name" : {
"description" : "The name of the table" ,
"type" : "string"
} ,
2022-02-21 17:37:02 +01:00
"primaryDisplay" : {
"type" : "string" ,
"description" : "The name of the column which should be used in relationship tags when relating to this table."
} ,
2022-02-18 19:06:58 +01:00
"schema" : {
2022-02-21 17:37:02 +01:00
"oneOf" : [
{
"type" : "object" ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"link"
] ,
"description" : "A relationship column."
} ,
"constraints" : {
"type" : "object" ,
"description" : "A constraint can be applied to the column which will be validated against when a row is saved." ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"string" ,
"number" ,
"object" ,
"boolean"
]
} ,
"presence" : {
"type" : "boolean" ,
"description" : "Defines whether the column is required or not."
}
}
} ,
"name" : {
"type" : "string" ,
"description" : "The name of the column."
} ,
"autocolumn" : {
"type" : "boolean" ,
"description" : "Defines whether the column is automatically generated."
} ,
"fieldName" : {
"type" : "string" ,
"description" : "The name of the column which a relationship column is related to in another table."
} ,
"tableId" : {
"type" : "string" ,
"description" : "The ID of the table which a relationship column is related to."
} ,
"relationshipType" : {
"type" : "string" ,
"enum" : [
"one-to-many" ,
"many-to-one" ,
"many-to-many"
] ,
"description" : "Defines the type of relationship that this column will be used for."
} ,
"through" : {
"type" : "string" ,
"description" : "When using a SQL table that contains many to many relationships this defines the table the relationships are linked through."
} ,
"foreignKey" : {
"type" : "string" ,
"description" : "When using a SQL table that contains a one to many relationship this defines the foreign key."
} ,
"throughFrom" : {
"type" : "string" ,
"description" : "When using a SQL table that utilises a through table, this defines the primary key in the through table for this table."
} ,
"throughTo" : {
"type" : "string" ,
"description" : "When using a SQL table that utilises a through table, this defines the primary key in the through table for the related table."
}
}
} ,
{
"type" : "object" ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"formula"
] ,
"description" : "A formula column."
} ,
"constraints" : {
"type" : "object" ,
"description" : "A constraint can be applied to the column which will be validated against when a row is saved." ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"string" ,
"number" ,
"object" ,
"boolean"
]
} ,
"presence" : {
"type" : "boolean" ,
"description" : "Defines whether the column is required or not."
}
}
} ,
"name" : {
"type" : "string" ,
"description" : "The name of the column."
} ,
"autocolumn" : {
"type" : "boolean" ,
"description" : "Defines whether the column is automatically generated."
} ,
"formula" : {
"type" : "string" ,
"description" : "Defines a Handlebars or JavaScript formula to use, note that Javascript formulas are expected to be provided in the base64 format."
} ,
"formulaType" : {
"type" : "string" ,
"enum" : [
"static" ,
"dynamic"
] ,
"description" : "Defines whether this is a static or dynamic formula."
}
}
} ,
{
"type" : "object" ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"string" ,
"longform" ,
"options" ,
"number" ,
"boolean" ,
"array" ,
"datetime" ,
"attachment" ,
"link" ,
"formula" ,
"auto" ,
"json" ,
"internal"
] ,
"description" : "Defines the type of the column, most explain themselves, a link column is a relationship."
} ,
"constraints" : {
"type" : "object" ,
"description" : "A constraint can be applied to the column which will be validated against when a row is saved." ,
"properties" : {
"type" : {
"type" : "string" ,
"enum" : [
"string" ,
"number" ,
"object" ,
"boolean"
]
} ,
"presence" : {
"type" : "boolean" ,
"description" : "Defines whether the column is required or not."
}
}
} ,
"name" : {
"type" : "string" ,
"description" : "The name of the column."
} ,
"autocolumn" : {
"type" : "boolean" ,
"description" : "Defines whether the column is automatically generated."
}
2022-02-18 19:06:58 +01:00
}
}
2022-02-21 17:37:02 +01:00
]
2022-02-18 19:06:58 +01:00
}
}
2022-02-18 18:44:08 +01:00
}
2022-02-17 19:58:09 +01:00
}
} ,
2022-02-18 16:47:15 +01:00
"security" : [
{
"ApiKeyAuth" : [ ]
}
] ,
2022-02-16 19:23:38 +01:00
"paths" : {
2022-02-21 17:37:02 +01:00
"/queries/search" : {
"post" : {
"summary" : "Search for a query based on its name." ,
"tags" : [
"queries"
]
}
} ,
"/queries/{queryId}" : {
"post" : {
"summary" : "Execute a query and retrieve its response." ,
"tags" : [
"queries"
]
}
} ,
2022-02-17 20:55:37 +01:00
"/tables/{tableId}/rows/search" : {
2022-02-16 19:23:38 +01:00
"post" : {
2022-02-18 16:47:15 +01:00
"summary" : "Used to search for rows within a table." ,
"tags" : [
"rows"
] ,
2022-02-17 13:40:08 +01:00
"parameters" : [
{
2022-02-17 20:55:37 +01:00
"$ref" : "#/components/parameters/tableId"
2022-02-18 18:44:08 +01:00
} ,
{
"$ref" : "#/components/parameters/appId"
2022-02-16 19:51:17 +01:00
}
2022-02-17 13:40:08 +01:00
] ,
2022-02-16 19:51:17 +01:00
"requestBody" : {
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"properties" : {
2022-02-17 19:58:09 +01:00
"query" : {
2022-02-16 19:51:17 +01:00
"type" : "object" ,
2022-02-17 19:58:09 +01:00
"properties" : {
"string" : {
"type" : "object" ,
"example" : {
"columnName1" : "value" ,
"columnName2" : "value"
} ,
"description" : "A map of field name to the string to search for, this will look for rows that have a value starting with the string value." ,
"additionalProperties" : {
"type" : "string" ,
"description" : "The value to search for in the column."
}
} ,
"fuzzy" : {
"type" : "object" ,
"description" : "A fuzzy search, only supported by internal tables."
} ,
"range" : {
"type" : "object" ,
2022-02-18 18:44:08 +01:00
"description" : "Searches within a range, the format of this must be columnName -> [low, high]." ,
"example" : {
"columnName1" : [
10 ,
20
]
}
2022-02-17 19:58:09 +01:00
} ,
"equal" : {
"type" : "object" ,
"description" : "Searches for rows that have a column value that is exactly the value set."
} ,
"notEqual" : {
"type" : "object" ,
"description" : "Searches for any row which does not contain the specified column value."
} ,
"empty" : {
"type" : "object" ,
2022-02-18 18:44:08 +01:00
"description" : "Searches for rows which do not contain the specified column. The object should simply contain keys of the column names, these can map to any value." ,
"example" : {
"columnName1" : ""
}
2022-02-17 19:58:09 +01:00
} ,
"notEmpty" : {
"type" : "object" ,
"description" : "Searches for rows which have the specified column."
} ,
"oneOf" : {
"type" : "object" ,
"description" : "Searches for rows which have a column value that is any of the specified values. The format of this must be columnName -> [value1, value2]."
}
2022-02-17 13:40:08 +01:00
}
2022-02-16 19:51:17 +01:00
} ,
2022-02-17 19:58:09 +01:00
"paginate" : {
"type" : "boolean" ,
"description" : "Enables pagination, by default this is disabled."
2022-02-16 19:51:17 +01:00
} ,
2022-02-17 19:58:09 +01:00
"bookmark" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "integer"
}
] ,
"description" : "If retrieving another page, the bookmark from the previous request must be supplied."
2022-02-16 19:51:17 +01:00
} ,
2022-02-17 19:58:09 +01:00
"limit" : {
"type" : "integer" ,
"description" : "The maximum number of rows to return, useful when paginating, for internal tables this will be limited to 1000, for SQL tables it will be 5000."
2022-02-16 19:51:17 +01:00
} ,
2022-02-17 19:58:09 +01:00
"sort" : {
2022-02-16 19:51:17 +01:00
"type" : "object" ,
2022-02-17 19:58:09 +01:00
"description" : "A set of parameters describing the sort behaviour of the search." ,
"properties" : {
"order" : {
"type" : "string" ,
"enum" : [
"ascending" ,
"descending"
] ,
"description" : "The order of the sort, by default this is ascending."
} ,
"column" : {
"type" : "string" ,
"description" : "The name of the column by which the rows will be sorted."
} ,
"type" : {
"type" : "string" ,
"enum" : [
"string" ,
"number"
] ,
"description" : "Defines whether the column should be treated as a string or as numbers when sorting."
}
}
2022-02-16 19:51:17 +01:00
}
}
}
}
}
} ,
2022-02-16 19:23:38 +01:00
"responses" : {
"200" : {
2022-02-17 19:58:09 +01:00
"description" : "The response will contain an array of rows that match the search parameters." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"properties" : {
"rows" : {
"description" : "An array of rows, these will each contain an _id field which can be used to update or delete them." ,
"type" : "array" ,
"items" : {
2022-02-18 16:47:15 +01:00
"type" : "object"
2022-02-17 19:58:09 +01:00
}
} ,
"bookmark" : {
"oneOf" : [
{
"type" : "string"
} ,
{
"type" : "integer"
}
] ,
2022-02-18 16:47:15 +01:00
"description" : "If pagination in use, this should be provided."
2022-02-17 19:58:09 +01:00
} ,
"hasNextPage" : {
"description" : "If pagination in use, this will determine if there is another page to fetch." ,
"type" : "boolean"
}
2022-02-18 18:44:08 +01:00
}
} ,
"examples" : {
"search" : {
"$ref" : "#/components/examples/search"
2022-02-17 19:58:09 +01:00
}
}
}
}
2022-02-16 19:23:38 +01:00
}
}
}
2022-02-17 20:55:37 +01:00
} ,
"/tables/{tableId}/rows" : {
"post" : {
2022-02-18 16:47:15 +01:00
"summary" : "Creates a new row within a specified table." ,
"tags" : [
"rows"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
2022-02-18 18:44:08 +01:00
} ,
{
"$ref" : "#/components/parameters/appId"
2022-02-18 16:47:15 +01:00
}
] ,
"requestBody" : {
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
2022-02-18 18:44:08 +01:00
"$ref" : "#/components/schemas/row"
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/inputRow"
2022-02-18 16:47:15 +01:00
}
}
}
}
} ,
"responses" : {
"200" : {
"description" : "Returns the created row, including the ID which has been generated for it. This can be found in the Budibase portal, viewed under the developer information." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
}
} ,
"/tables/{tableId}/rows/{rowId}" : {
"put" : {
"summary" : "Update a single row within a specified table." ,
"tags" : [
"rows"
] ,
2022-02-17 20:55:37 +01:00
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
2022-02-18 16:47:15 +01:00
} ,
{
"$ref" : "#/components/parameters/rowId"
2022-02-18 18:44:08 +01:00
} ,
{
"$ref" : "#/components/parameters/appId"
2022-02-17 20:55:37 +01:00
}
] ,
2022-02-18 18:44:08 +01:00
"requestBody" : {
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/row"
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/inputRow"
}
}
}
}
} ,
2022-02-17 20:55:37 +01:00
"responses" : {
"200" : {
"description" : "Returns the created row, including the ID which has been generated for it." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
2022-02-18 16:47:15 +01:00
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
} ,
"delete" : {
"summary" : "Delete a single row from the specified table." ,
"tags" : [
"rows"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
} ,
{
"$ref" : "#/components/parameters/rowId"
2022-02-18 18:44:08 +01:00
} ,
{
"$ref" : "#/components/parameters/appId"
2022-02-18 16:47:15 +01:00
}
] ,
"responses" : {
"200" : {
"description" : "Returns the deleted row, including the ID which has been generated for it." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
} ,
"get" : {
"summary" : "Get a single row from the specified table." ,
"tags" : [
"rows"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
} ,
{
"$ref" : "#/components/parameters/rowId"
2022-02-18 18:44:08 +01:00
} ,
{
"$ref" : "#/components/parameters/appId"
2022-02-18 16:47:15 +01:00
}
] ,
"responses" : {
"200" : {
"description" : "Returns the retrieved row." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"row" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
}
} ,
2022-02-18 18:44:08 +01:00
"/tables/search" : {
"post" : {
"summary" : "Search internal and external tables based on their name." ,
2022-02-18 19:06:58 +01:00
"tags" : [
"tables"
] ,
2022-02-18 18:44:08 +01:00
"parameters" : [
{
"$ref" : "#/components/parameters/appId"
}
] ,
2022-02-18 19:06:58 +01:00
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"properties" : {
"name" : {
"type" : "string" ,
2022-02-21 17:37:02 +01:00
"description" : "The name of the table, this is a case insensitive search using the provided name as a starts with search."
2022-02-18 19:06:58 +01:00
}
}
}
}
}
} ,
2022-02-18 18:44:08 +01:00
"responses" : {
"200" : {
"description" : "Returns the found tables, based on the search parameters." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "array" ,
"items" : {
"type" : "object"
}
} ,
"examples" : {
"tables" : {
"$ref" : "#/components/examples/tables"
}
}
}
}
}
}
}
} ,
2022-02-18 16:47:15 +01:00
"/tables" : {
"post" : {
2022-02-18 18:44:08 +01:00
"summary" : "Create a new table." ,
2022-02-18 19:06:58 +01:00
"tags" : [
"tables"
] ,
2022-02-18 18:44:08 +01:00
"parameters" : [
{
"$ref" : "#/components/parameters/appId"
}
] ,
2022-02-18 19:06:58 +01:00
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/table"
} ,
"examples" : {
"table" : {
"$ref" : "#/components/examples/table"
}
}
}
}
} ,
2022-02-18 16:47:15 +01:00
"responses" : {
"200" : {
2022-02-18 18:44:08 +01:00
"description" : "Returns the created table, including the ID which has been generated for it. This can be internal or external data sources." ,
2022-02-18 16:47:15 +01:00
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
2022-02-18 18:44:08 +01:00
"table" : {
"$ref" : "#/components/examples/table"
}
}
}
}
}
}
2022-02-21 17:37:02 +01:00
}
} ,
"/tables/:tableId" : {
"put" : {
"summary" : "Update the specified table. This can be for internal or external tables." ,
2022-02-18 18:44:08 +01:00
"tags" : [
"tables"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
} ,
{
"$ref" : "#/components/parameters/appId"
}
] ,
2022-02-21 17:37:02 +01:00
"requestBody" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/table"
} ,
"examples" : {
"table" : {
"$ref" : "#/components/examples/table"
}
}
}
}
} ,
2022-02-18 18:44:08 +01:00
"responses" : {
"200" : {
2022-02-21 17:37:02 +01:00
"description" : "Returns the updated table." ,
2022-02-18 18:44:08 +01:00
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"table" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
}
} ,
2022-02-21 17:37:02 +01:00
"/tables/{tableId}" : {
"get" : {
"summary" : "Get a single table by its ID, internal and external within an app." ,
2022-02-18 18:44:08 +01:00
"tags" : [
"tables"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
} ,
{
"$ref" : "#/components/parameters/appId"
}
] ,
"responses" : {
"200" : {
2022-02-21 17:37:02 +01:00
"description" : "Returns the table that was found." ,
2022-02-18 18:44:08 +01:00
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"table" : {
"$ref" : "#/components/examples/row"
}
}
}
}
}
}
2022-02-21 17:37:02 +01:00
} ,
2022-02-18 18:44:08 +01:00
"delete" : {
"summary" : "Delete a single table and all of its data." ,
"tags" : [
"tables"
] ,
"parameters" : [
{
"$ref" : "#/components/parameters/tableId"
} ,
{
"$ref" : "#/components/parameters/appId"
}
] ,
"responses" : {
"200" : {
"description" : "Returns the deleted table." ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object"
} ,
"examples" : {
"table" : {
2022-02-18 16:47:15 +01:00
"$ref" : "#/components/examples/table"
}
2022-02-17 20:55:37 +01:00
}
}
}
}
}
}
2022-02-16 19:23:38 +01:00
}
} ,
2022-02-16 17:42:50 +01:00
"tags" : [ ]
}