This is the official Go SDK for Kontenbase API.

Kontenbase is a no-code backend API platform or Backend as a Service (BaaS) that allows you to create a backend API as fast as possible. We make it easy for developers to build backend API without having to touch backend code at all.

Visit Kontenbase for more information and see our documentation for more technical details.

API Documentation

For API documentation, visit Kontenbase API Reference.


go get github.com/kontenbase/kontenbase-go


Before you begin, you need to sign up on Kontenbase Dashboard to retrieve an API key of your project.

Create a client

client := kontenbase.NewClient("YOUR_API_KEY", kontenbase.DefaultURL())



resp, err := client.Auth.Register(client.RegisterParams{
  Email: "[email protected]",
  Password: "password",
  FirstName: "Ega",


resp, err := client.Auth.Login(client.LoginParams{
  Email: "[email protected]",
  Password: "password",

Get user info

resp, err := client.Auth.User()

Update user info

resp, err := client.Auth.Update(map[string]interface{}{
  "firstName": "Ega",


resp, err := client.Auth.Logout()


Create a new record

resp, err := client.Service("posts").Create(map[string]interface{}{
  "name" : "Post 1",
  "notes": "Hello Kontenbase",

Get a record by Id

resp, err := client.Service("posts").GetByID("605a251d7b8678bf6811k3b1")

Find records

Get all records

resp, err := client.Service("posts").Find()

Find records and modify the result

resp, err := client.Service("posts").Find()
  .SetSelect([]interface{}{"name", "notes"})

Find records with criteria

resp, err := client.Service("posts").Find()
    "name": "Ega",
    "notes": map[string]interface{}{
      "$contains": "hello",
    "number": map[string]interface{}{
      "$gte": 10,
    "status" map[string]interface{}{
      "$in": []interface{}{"todo", "done"},

Update record

resp, err := client.Service("posts").UpdateByID("605a251d7b8678bf6811k3b1", map[string]interface{}{
    "notes": "Hello world",

Delete record

resp, err := client.Service("posts").DeleteByID("605a251d7b8678bf6811k3b1")

Link record

resp, err := client.Service("posts").Link("605a251d7b8678bf6811k3b1", map[string]interface{}{
    "categories": "61d26e8e2adb12b85c33029c",

Unlink record

resp, err := client.Service("posts").Unlink("605a251d7b8678bf6811k3b1", map[string]interface{}{
    "categories": "61d26e8e2adb12b85c33029c",

Count total records

Count all records

resp, err := client.Service("posts").Count()

Count records that match given criteria

resp, err := client.Service("posts").Count().SetWhere(map[string]interface{}{
    "name": "Ega",


Upload a file

file, err := os.Open("your_file.txt")
if err != nil {
  return err

defer file.Close()

resp, err := client.Storage.Upload(file)


Please use our GitHub Issues for high-level feedback. Also you can join our Discord server.


View Github