🎛️
Lowcoder API Specification
  • Authentication
  • API reference Lowcoder
    • Api Lowcoder v2.0.1
      • Users
        • Password
        • NewUserGuidanceShown
        • Mark status
        • Reset password
        • Photo
        • UserDetail
        • Me
        • CurrentUser
      • Datasources
        • Permissions
        • Test
        • GetPluginDynamicConfig
        • Structure
        • ListByOrg
        • ListByApp
        • JsDatasourcePlugins
        • Info
      • Applications
        • Public to all
        • Permissions
        • Restore
        • Recycle
          • List
        • Publish
        • CreateFromTemplate
        • View
        • List
        • Home
      • Library queries
        • Publish
        • ListByOrg
        • DropDownList
      • Folders
        • Permissions
        • Move
        • Elements
      • Organizations
        • Update
        • Role
        • Common settings
        • SwitchOrganization
        • Logo
        • Members
        • DatasourceTypes
        • Remove
        • Leave
      • Invitation
        • Invite
      • Groups
        • Update
        • Role
        • AddMember
        • Members
        • List
        • Remove
        • Leave
      • Configs
        • DeploymentId
      • Materials
        • List
      • Assets
      • Library query records
        • ListByLibraryQueryId
      • Query
        • Execute from node
        • Execute
      • Auth
        • Logout
        • Config
        • Configs
        • Tp
          • Login
        • Form
          • Login
      • Application
        • History snapshots
      • State
        • HealthCheck
      • Misc
        • Js library
          • Recommendations
          • Metas
      • Specification
    • Api Lowcoder v2.1.4
      • Users
        • Password
        • NewUserGuidanceShown
        • Mark status
        • Reset password
        • Photo
        • UserDetail
        • Me
        • CurrentUser
      • Datasources
        • Permissions
        • Test
        • GetPluginDynamicConfig
        • Structure
        • ListByOrg
        • ListByApp
        • JsDatasourcePlugins
        • Info
      • Applications
        • Public to all
        • Permissions
        • Restore
        • Recycle
          • List
        • Publish
        • CreateFromTemplate
        • View
        • List
        • Home
      • Library queries
        • Publish
        • ListByOrg
        • DropDownList
      • Folders
        • Permissions
        • Move
        • Elements
      • Organizations
        • Update
        • Role
        • Common settings
        • SwitchOrganization
        • Logo
        • Members
        • DatasourceTypes
        • Remove
        • Leave
      • Invitation
        • Invite
      • Groups
        • Update
        • Role
        • AddMember
        • Members
        • List
        • Remove
        • Leave
      • Configs
        • DeploymentId
      • Materials
        • List
      • Assets
      • Library query records
        • ListByLibraryQueryId
      • Query
        • Execute from node
        • Execute
      • Auth
        • Logout
        • Config
        • Configs
        • Tp
          • Login
        • Form
          • Login
      • Application
        • History snapshots
      • State
        • HealthCheck
      • Misc
        • Js library
          • Recommendations
          • Metas
      • Specification
    • API Lowcoder v2.1.6
      • Users
        • Password
        • NewUserGuidanceShown
        • Mark status
        • Reset password
        • Photo
        • UserDetail
        • Me
        • CurrentUser
      • Datasources
        • Permissions
        • Test
        • GetPluginDynamicConfig
        • Structure
        • ListByOrg
        • ListByApp
        • JsDatasourcePlugins
        • Info
      • Applications
        • Public to all
        • Permissions
        • Restore
        • Recycle
          • List
        • Publish
        • CreateFromTemplate
        • View
        • List
        • Home
      • Library queries
        • Publish
        • ListByOrg
        • DropDownList
      • Folders
        • Permissions
        • Move
        • Elements
      • Organizations
        • Update
        • Role
        • Common settings
        • SwitchOrganization
        • Logo
        • Members
        • DatasourceTypes
        • Remove
        • Leave
      • Groups
        • Update
        • Role
        • AddMember
        • Members
        • List
        • Remove
        • Leave
      • Configs
        • DeploymentId
      • Invitation
        • Invite
      • Materials
        • List
      • Assets
      • Library query records
        • ListByLibraryQueryId
      • Query
        • Execute from node
        • Execute
      • Application
        • History snapshots
      • Misc
        • Js library
          • Recommendations
          • Metas
      • Auth
        • Logout
        • Config
        • Api key
        • Configs
        • Api keys
        • Tp
          • Login
        • Form
          • Login
      • State
        • HealthCheck
    • Specification
Powered by GitBook
On this page

Last updated 1 year ago

Lowcoder comes with a feature-rich API, so you can use it in Lowcoder Apps or extend Lowcoder with new Functionality.

On you can access this API as well, just some endpoints are not available.

Authentication

Session Cookie

In application properties of the API-Service - or as ENV Variable in Docker setups, you can set a name for the Cookie. In our ExamplesLOWCODER_CE_SELFHOST_TOKEN

With this value, you can then authenticate API Calls.

If no user is logged In, API Calls will get executed in the name of "Anonymous User" and for most of the API Calls, this user has no desired rights.

If you are logged in, the Cookie of the currently logged-in user will be used to make API Calls in the name of the current user. This means, that Access Rights to different Functions are automatically applied by the Role of the User. (Admin, Member, Visitor)

If you want to use the API from outside of Lowcoder, you need to authenticate first and use the Cookie as the LOWCODER_CE_SELFHOST_TOKEN API key in every API Call.

When successfully logged in, you will get the following Response:

In particular, you will get back the Cookie to authorize the next API Calls.

For all the next API Calls you need to set the Cookie

API Key

Since Lowcoder v2.1.3 you can create and use alternatively also a JWT-based API Key.

As a logged-in user, you can use the API based on the Cookie to generate an API Key.

In return, you will get a JSON response containing the API key

For all further API Calls, you can then use the API Key, which impersonates the logged-in user, that created the API Key.

As the API Key impersonates the user, who created the API Key (based on the Cookie), all rights of that impersonated User are also active via API Key.

// Login Method Response

{
    "code": 1,
    "message": "",
    "data": true,
    "success": true
}
// Cookie in Response
LOWCODER_CE_SELFHOST_TOKEN=<generatedCookieValue>; Path=/; Max-Age=2592000; Expires=Tue, 25 Jul 2023 13:51:31 GMT; HttpOnly; SameSite=Lax
// API Requests authorized
curl --location 'http://localhost:3000//api/users/currentUser' \
--header 'Accept: */*' \
--header 'Cookie: LOWCODER_CE_SELFHOST_TOKEN=<generatedCookieValue>'
// use the Lowcoder API to generate the JWT based API Key
curl --location '<your lowcoder location>/api/auth/api-key' \
--header 'cookie: LOWCODER_CE_SELFHOST_TOKEN=<generatedCookieValue>;' \
--header 'Content-Type: application/json' \
--data '{
    "name":"<your api key name>",
    "description": "A wonderful API Key"
}'
{
    "code": 1,
    "message": "",
    "data": {
        "id": "<the generated API Key Id",
        "token": "ey...<the JSON Web Token>"
    },
    "success": true
}

Authentication

NextAPI reference Lowcoder
  • Authentication
  • Session Cookie
  • API Key
// Login a User on Lowcoder by eMail

curl --location '//api/auth/form/login' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "loginId": "<your_user>",
  "password": "<your_password>",
  "register": "false",
  "source": "EMAIL",
  "authId": "EMAIL"
}'
api-service.lowcoder.cloud