Skip to content
undb Docs

Open API

Create Open API

When a table is created in Undb, the system automatically generates and synchronizes a related OpenAPI. A ‘API Preview’ button is then provided at the top of the table operation column for accessing the OpenAPI view.

Click on the ‘API Preview’ button in the left window to view the display interface of the Open API preview in the right window.

Open API Preview

API Detail

The system automatically generated nine types of Application Programming Interfaces (APIs).

API nameMethodsCategory
List table recordsGETRecord
Create table recordPOSTRecord
Delete table records by idsDELETERecord
Update table recordPATCHRecord
Get table record by idGETRecord
Duplicate table record by idPOSTRecord
Delete table record by idDELETERecord
Create table records bulkPOSTRecord
Update table records bulkPATCHRecord
Create table webhookPOSTWebhook
Update table webhookPATCHWebhook
Get table webhookGETWebhook
Delete table webhookDELETEWebhook
Subscribe table record eventsGETSubscribe
  • At the API preview interface, users can view the OpenAPI created for the corresponding table, as well as request and response examples for the API.

open api detail

  • The structure of the API will be automatically generated based on the corresponding table structure, as shown in the following figure.

Illustrating with the data table from the demo website

structure of the Table

open api detail

structure of the API

// get list Company records
{
  "records": [
    {
      "id": "rec16l53qwc",
      "Company": "Company Name 1",
      "createdAt": "2023-05-20T16:10:44.000Z",
      "createdBy": {
        "id": "usrzvhv8srb",
        "username": "wanshufen",
        "avatar": null,
        "color": "blue"
      },
      "updatedAt": "2023-05-20T16:25:06.000Z",
      "updatedBy": {
        "id": "usrzvhv8srb",
        "username": "wanshufen",
        "avatar": null,
        "color": "blue"
      },
      "Contacts": [
        {
          "id": "recqymnue1f",
          "value": ["Ambrose"]
        }
      ],
      "Title": [
        {
          "id": "rec2qr07yes",
          "value": ["CEO"]
        }
      ],
      "Title Name": "CEO"
    }
  ]
}

structure of the table

api response

structure of the API

// get list employees records

{
  "records": [
    {
      "id": "recm1kabi9l",
      "Employee": "Vincent",
      "Title": "manager 1",
      "createdAt": "2023-05-21T08:54:22.000Z",
      "createdBy": {
        "id": "usrzvhv8srb",
        "username": "wanshufen",
        "avatar": null,
        "color": "blue"
      },
      "updatedAt": "2023-05-27T18:56:08.000Z",
      "updatedBy": {
        "id": "usrbuajh55q",
        "username": "test",
        "avatar": null,
        "color": "rose"
      },
      "Level": 3,
      "Employee ID": 1,
      "subordinate": [
        {
          "id": "recvpmpb1bv",
          "value": ["Ford"]
        }
      ],
      "Superior": {
        "id": "recngzo73ge",
        "value": ["Scott"]
      }
    }
  ]
}

Based on the example above, the interface generated for different data tables will also be different.