Skip to main content

LOQED web API integration

Advanced guide for developers: receive lock events with webhooks, control your LOQED lock, and change lock settings such as Open House Mode and Twist Assist using the LOQED APIs.

Some smart home platforms and devices do not have a direct LOQED integration yet. If you are an advanced user or a developer, you can build your own integration using the LOQED APIs. Before you start, we recommend reading our article "Advanced users: Available APIs" first.

LOQED offers three ways to integrate with your lock:

  • Outgoing webhooks – let your lock notify an external URL whenever its state changes (for example, to trigger automations).

  • Incoming webhooks – control your lock (open, latch, night lock) from another service or device.

  • Integrations API – a token-based REST API to list your locks, change the lock state, and change lock settings such as Open House Mode and Twist Assist.

Outgoing webhooks: call an external URL when the lock changes

When the lock reaches a new position (open, unlock/day lock, lock/night lock), the LOQED backend can send (POST) data to a URL of your choice. You can register the URL you want to be called in the API section on app.loqed.com (see below).

Because not all systems support JSON, you can also configure a separate URL per event (for example one URL for opening and one for locking). In that case the requested_state value is always the same for that URL.

Event payload: state reached

This payload is sent when the lock has reached a position. Example of the JSON that is POSTed to your URL:

{
"requested_state": "DAY_LOCK",
"event_type": "STATE_CHANGED_LATCH",
"lock_id": "Yq1gK4oeE9KWe0ByxjX2",
"key_local_id": 3,
"key_name_user": "Front door",
"key_name_admin": "Jane Doe",
"key_account_e-mail": "jane@example.com",
"key_account_name": "Jane Doe"
}

Fields

  • requested_state – the position that was reached: OPEN, DAY_LOCK, NIGHT_LOCK or UNKNOWN.

  • event_type – one of:

    • STATE_CHANGED_OPEN (requested_state = OPEN)

    • STATE_CHANGED_LATCH (requested_state = DAY_LOCK)

    • STATE_CHANGED_NIGHT_LOCK (requested_state = NIGHT_LOCK)

    • STATE_CHANGED_UNKNOWN (requested_state = UNKNOWN)

    • MOTOR_STALL (requested_state = UNKNOWN)

  • lock_id – the identifier of your lock.

  • key_local_id, key_name_user, key_name_adminnull when the action was not triggered by a key (for example a manual turn of the knob or a button press).

  • key_account_e-mail, key_account_namenull for manual actions, or when a PIN is used that is not linked to an account.

Event payload: going to a state

You can also receive a webhook when the lock starts moving towards a new position. The lock might not actually reach the position (for example when the batteries are almost empty). These events set the go_to_state attribute with the target bolt state.

{
"go_to_state": "OPEN",
"event_type": "GO_TO_STATE_INSTANTOPEN_OPEN",
"lock_id": "Yq1gK4oeE9KWe0ByxjX2",
"key_local_id": 3,
"key_name_user": "Front door",
"key_name_admin": "Jane Doe",
"key_account_e-mail": "jane@example.com",
"key_account_name": "Jane Doe"
}

Possible go_to_state values: OPEN, DAY_LOCK, NIGHT_LOCK.

Possible event_type values:

  • GO_TO_STATE_INSTANTOPEN_OPENTouch to Open (go_to_state = OPEN)

  • GO_TO_STATE_INSTANTOPEN_LATCHAuto Unlock (go_to_state = DAY_LOCK)

  • GO_TO_STATE_MANUAL_UNLOCK_BLE_OPEN (go_to_state = OPEN)

  • GO_TO_STATE_MANUAL_LOCK_BLE_LATCH (go_to_state = DAY_LOCK)

  • GO_TO_STATE_MANUAL_LOCK_BLE_NIGHT_LOCK (go_to_state = NIGHT_LOCK)

  • GO_TO_STATE_TWIST_ASSIST_OPEN (go_to_state = OPEN)

  • GO_TO_STATE_TWIST_ASSIST_LATCH (go_to_state = DAY_LOCK)

  • GO_TO_STATE_TWIST_ASSIST_LOCK (go_to_state = NIGHT_LOCK)

  • GO_TO_STATE_MANUAL_UNLOCK_VIA_OUTSIDE_MODULE_PIN (go_to_state = OPEN)

  • GO_TO_STATE_MANUAL_UNLOCK_VIA_OUTSIDE_MODULE_BUTTON (go_to_state = OPEN)

  • GO_TO_STATE_TOUCH_TO_LOCK (go_to_state = NIGHT_LOCK)

  • GO_TO_STATE_MANUAL_UNLOCK_REMOTE_OPEN

  • GO_TO_STATE_MANUAL_LOCK_REMOTE_LATCH

  • GO_TO_STATE_MANUAL_LOCK_REMOTE_NIGHT_LOCK

The lock_id and key_* fields behave the same as described above.

Bluetooth and Wi-Fi strength webhook

Every few hours, and whenever the lock or bridge is powered on, an update of the signal levels can be sent. Enable the corresponding checkmark in the API section on app.loqed.com to receive this information.

{
"ble_strength": 42,
"wifi_strength": 73,
"battery_percentage": 88,
"lock_id": "Yq1gK4oeE9KWe0ByxjX2"
}
  • ble_strength – Bluetooth signal as a percentage. This fluctuates a lot, so don't worry if it is low.

  • wifi_strength – Wi-Fi signal as a percentage.

  • battery_percentage – battery level as a percentage.

  • lock_id – the identifier of your lock.

Lock online webhook

Every few hours, and whenever the lock or bridge is powered on, an "online" update can be sent. Enable the corresponding checkmark to receive this information.

{
"online": 1,
"lock_id": "Yq1gK4oeE9KWe0ByxjX2"
}
  • online1 is sent as the value.

  • lock_id – the identifier of your lock.

Testing your webhook

We recommend using Webhook.site to verify that your smart lock is calling the webhook URL. It also lets you inspect the JSON data that is sent.

Incoming webhooks: control the lock

If you want to control your lock from a third-party service or device, you can do so with an HTTPS GET request to a LOQED URL.

Log in and open the API section

  1. Open app.loqed.com in your browser.

  2. Log in with the email address of your LOQED app account. A verification (2FA) code will be sent to your email – enter it to continue.

  3. In the menu, choose API. This is where you manage your outgoing and incoming webhooks and API keys.

Create an API key

On this page you can add outgoing webhooks and create incoming webhooks.

  • Click Add new API key.

  • Enter a name so you can recognise the key later. It can be anything – it does not have to match your key name.

  • If you have multiple locks, select the correct one from the Select Lock dropdown.

  • Click Add API key.

Your API key has now been created.

Call the API

The API currently supports the following commands:

  • Open – the door opens. An empty JSON object is returned.

  • Latch – the door is unlocked (day lock). An empty JSON object is returned.

  • Night lock – the door is locked. An empty JSON object is returned.

  • Status – returns the current state of the lock (see below).

⚠️ Important: request the Status at most once per day. If you request it more than 12 times you will be blocked for 12 hours. Instead of polling the status, set up an outgoing webhook so your server is notified instantly whenever the lock state changes.

The Status command returns the following JSON:

{
"id": "Yq1gK4oeE9KWe0ByxjX2",
"bridge_online": 1,
"lock_online": 1,
"battery_percentage": 88,
"battery_type": 0,
"bolt_state_numeric": 2,
"bolt_state": "day_lock",
"guest_access_mode": 0,
"twist_assist": 0,
"touch_to_connect": 0
}
  • id – lock identifier.

  • bridge_online1 if the bridge is online, otherwise 0.

  • lock_online1 if the lock is online, otherwise 0.

  • battery_percentage-1 if the lock is offline, otherwise 0100.

  • battery_type0 = Alkaline, 1 = NiMH, 2 = Lithium (non-rechargeable), 3 = unknown.

  • bolt_state_numeric0 = unknown, 1 = open, 2 = day_lock, 3 = night_lock.

  • bolt_stateunknown, open, day_lock or night_lock.

  • guest_access_mode1 if enabled, 0 if disabled.

  • twist_assist1 if enabled, 0 if disabled.

  • touch_to_connect1 if the Touch to Open 500 m restriction is removed, otherwise 0.

Let LOQED generate the digital signature

Commands to the smart lock must be digitally signed. The easiest option is to let the LOQED server generate this signature for you: simply use the four ready-made URLs (open, latch, night lock, status) shown in the API section on app.loqed.com.

Generate the digital signature yourself

If you prefer to keep your encryption key to yourself and not send it to the LOQED server, you can generate the digital signature yourself. At app.loqed.com/Backend-API-example we provide example code (JavaScript and PHP) that shows how the signature is created.

Integrations API: read locks and change settings

The Integrations API is a token-based REST API. With a single personal access token you can list your locks, change the lock state, and change lock settings such as Open House Mode and Twist Assist.

The base URL for all endpoints is:

https://integrations.production.loqed.com

Every request must include your personal access token in the Authorization header:

Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN

Generate a personal access token

Open the LOQED personal access token page and follow these steps:

  1. Log in with the email address of your LOQED app account (you need to be an admin).

  2. Tap Create.

  3. Give the token a recognisable name (for example the name of the integration you are building).

  4. Tap Save.

  5. Copy the token and store it somewhere safe – you will use it as the Bearer token in every request. Treat it like a password.

List your locks

Use this endpoint to retrieve all locks available to your account, including their current state and settings. You will need the lock id for the other endpoints.

GET https://integrations.production.loqed.com/api/locks/

Example with cURL:

curl -X GET "https://integrations.production.loqed.com/api/locks/" \
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN"

Example response:

{
"data": [
{
"id": "Yq1gK4oeE9KWe0ByxjX2",
"name": "Front door",
"model_name": "LOQED Touch",
"battery_percentage": 95,
"battery_type": "alkaline",
"bolt_state": "day_lock",
"party_mode": false,
"guest_access_mode": false,
"twist_assist": false,
"touch_to_connect": false,
"lock_direction": "counter_clockwise",
"mortise_lock_type": "cylinder_operated_no_handle_on_the_outside",
"supported_lock_states": [
"open",
"day_lock",
"night_lock"
]
}
]
}

Change the lock state

Operate a lock by calling the bolt_state endpoint. The available bolt states are open, day_lock and night_lock.

GET https://integrations.production.loqed.com/api/locks/{lockId}/bolt_state/{boltState}

Example with cURL (unlock to day lock):

curl -X GET "https://integrations.production.loqed.com/api/locks/Yq1gK4oeE9KWe0ByxjX2/bolt_state/day_lock" \
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN"

Change a lock setting

Use this endpoint to change a lock setting such as Open House Mode, Twist Assist, the locking direction or the timezone.

POST https://integrations.production.loqed.com/api/locks/{lockId}/setting

Send a JSON body with the setting name and its new value. For example, to enable Open House Mode:

{
"setting_name": "open_house_mode",
"setting_value": 1
}

To enable Twist Assist:

{
"setting_name": "twist_assist",
"setting_value": 1
}

Full example with cURL:

curl -X POST "https://integrations.production.loqed.com/api/locks/Yq1gK4oeE9KWe0ByxjX2/setting" \
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"setting_name": "open_house_mode", "setting_value": 1}'

setting_value is a signed 32-bit integer. Most settings are simple on/off toggles that accept 0 (off) and 1 (on), but some expect specific values. Change one setting at a time and verify the result on your lock or in the LOQED app.

Available settings

The settings below are the most commonly used toggles (0 = off, 1 = on):

setting_name

What it does

open_house_mode

Keeps the door in day lock so it can be opened with the handle without unlocking each time.

twist_assist

Gives the bolt an extra twist to help operate stiff doors.

touch_to_connect

Removes the 500 m geofence requirement for Touch to Open.

touch_to_lock

Lock the door by touching the outside of the lock.

hold_to_lock

Lock the door by touching and holding the outside of the lock.

Tip: to confirm your token works, send a GET request to https://integrations.production.loqed.com/api/locks/ with your Authorization: Bearer header. A list of your locks confirms everything is set up correctly.

Did this answer your question?