Skip to main content

# Leapcell OpenAPI (0.0.1)

Download OpenAPI specification:Download

Leapcell OpenAPI Reference

LeapcellOpenAPI

get table's fields

get the table's fields, the table's fields is the table's columns

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

query Parameters
name_type
string
Enum: "name" "id"

name_type

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

delete records of table

delete the table's records, with filter

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

object

filter, filter condition

name_type
string
Default: "id"
Enum: "id" "name"

name type, name or id, default is id

Responses

Request samples

Content type
application/json
{
  • "filter": {
    },
  • "name_type": "id"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

create records of table

create the table's records, if on_conflict is not empty, action is update, otherwise is insert. create single or multiple records.

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

action
string
Default: "insert"
Enum: "insert" "update"

action, insert or update, default is insert, if on_conflict is not empty, action is update

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

on_conflict
Array of strings

if exists, not create, update

object

example: {"name":"test", "age": 18}

Array of objects

Responses

Request samples

Content type
application/json
{
  • "action": "insert",
  • "name_type": "id",
  • "on_conflict": [
    ],
  • "record": {
    },
  • "records": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

update records of table

update the table's records, with filter, order, limit, offset, fields, name_type, etc.

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

object

fields, if empty, return all fields

object

filter, filter condition

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

Responses

Request samples

Content type
application/json
{
  • "fields": {
    },
  • "filter": {
    },
  • "name_type": "id"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

delete record

delete record

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

recordId
required
string

record id

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": { },
  • "error": ""
}

get record

get record

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

recordId
required
string

record id

Request Body schema: application/json

body

fields
Array of strings

fields, if empty, return all fields

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

Responses

Request samples

Content type
application/json
{
  • "fields": [
    ],
  • "name_type": "id"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

update record

update record

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

recordId
required
string

record id

Request Body schema: application/json

body

object

fields, if empty, return all fields

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

Responses

Request samples

Content type
application/json
{
  • "fields": {
    },
  • "name_type": "id"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

get records' metrics

get the table's records' metrics, like count, max, min, avg, sum

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

filter
object

filter, condition filter

object

metrics, like count, max, min, avg, sum

Array of objects (openapi.FieldMetric)

metrics, like count, max, min, avg, sum

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

Responses

Request samples

Content type
application/json
{
  • "filter": { },
  • "metric": {
    },
  • "metrics": [
    ],
  • "name_type": "id"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

get records of table

get the table's records, with filter, order, limit, offset, fields, name_type, etc.

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

fields
Array of strings

fields, if empty, return all fields

filter
object

filter, condition filter

limit
integer [ 1 .. 100 ]
Default: 50

limit of records

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

offset
integer [ 0 .. 1000000 ]
Default: 0

offset of records

object

order by, if empty, order by id desc

Array of objects

order by, if empty, order by id desc

skip
integer [ 0 .. 1000000 ]
Default: 0

skip of records, same as offset, use offset first

take
integer [ 1 .. 100 ]
Default: 50

take of records, same as limit, use limit first

Responses

Request samples

Content type
application/json
{
  • "fields": [
    ],
  • "filter": { },
  • "limit": 50,
  • "name_type": "id",
  • "offset": 0,
  • "order": {
    },
  • "orders": [
    ],
  • "skip": 0,
  • "take": 50
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

search records of table

search the table's records, internal is a inverted index search, with fields, query, limit, offset, etc.

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: application/json

body

boost_fields
object

boost fields, key is field name, value is boost value, from 1 to 10, boost value would give the field more weight in search

fields
Array of strings

fields, it can not be empty

filter
object

filter, condition filter

limit
integer

limit of records

name_type
string
Default: "id"
Enum: "name" "id"

name type, name or id, default is id

offset
integer

offset of records

object

order by, if empty, order by id desc

Array of objects

order by, if empty, order by id desc

query
string

query, required, it can not be empty

search_fields
Array of strings

search fields, if empty, use fields

skip
integer

skip of records, same as offset, use offset first

take
integer

take of records, same as limit, use limit first

Responses

Request samples

Content type
application/json
{
  • "boost_fields": { },
  • "fields": [
    ],
  • "filter": { },
  • "limit": 50,
  • "name_type": "id",
  • "offset": 0,
  • "order": {
    },
  • "orders": [
    ],
  • "query": "name:john",
  • "search_fields": [
    ],
  • "skip": 0,
  • "take": 50
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

upload file

upload file, file only support jpg, png, file should be less than 3mb

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: multipart/form-data
file
required
string <binary>

file

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}

upload multiple file

upload multiple file, file only support jpg, png, file should be less than 3mb

Authorizations:
Bearer
path Parameters
tableId
required
string

table id

ownerName
required
string

owner name

repoName
required
string

repository name

Request Body schema: multipart/form-data
files
required
string <binary>

files

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "error": ""
}