curl --request POST \
--url https://api.uselora.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"shortcut.created"
],
"url": "https://example.com/hooks/lora",
"description": "Sync to the intranet"
}
'import requests
url = "https://api.uselora.com/v1/webhooks"
payload = {
"events": ["shortcut.created"],
"url": "https://example.com/hooks/lora",
"description": "Sync to the intranet"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['shortcut.created'],
url: 'https://example.com/hooks/lora',
description: 'Sync to the intranet'
})
};
fetch('https://api.uselora.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uselora.com/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'shortcut.created'
],
'url' => 'https://example.com/hooks/lora',
'description' => 'Sync to the intranet'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uselora.com/v1/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uselora.com/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabledReason": "manual",
"enabled": true,
"events": [
"shortcut.created"
],
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"source": "api",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>"
}{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabledReason": "manual",
"enabled": true,
"events": [
"shortcut.created"
],
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"source": "api",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"secret": "whsec_your_signing_secret"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>",
"reason": "not_a_url"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "plan_requires_upgrade",
"requestId": "<string>",
"traceId": "<string>",
"current_plan": "<string>",
"required_capability": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "payload_too_large",
"requestId": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "internal_error",
"requestId": "<string>",
"traceId": "<string>"
}Create a webhook endpoint
Creates a webhook endpoint that receives signed HTTP requests for the events it subscribes to. Needs the Business plan or above.
The response is the only place, besides the Rotate a signing secret operation, that returns the endpoint’s signing secret. Store it now: it cannot be read again.
The URL must use https, a public host name, and port 443 (the default) or 8443. IP addresses, local names such as localhost, and host names that resolve to a private, loopback or link-local address are refused (url_not_allowed), and Lora does not follow redirects when it sends. A workspace can have ten endpoints of its own, and each URL once.
An endpoint receives only events created after it was created. Nothing is sent for the past.
Send an Idempotency-Key to retry safely: for 24 hours, per workspace and API key, the same key with the same body returns the endpoint the first request created, without the secret (200), while that endpoint still exists. The same key with a different body is a 409. A retry is answered from what was stored, without checking the URL again, but it still needs the Business plan, so it answers 402 after a downgrade. Rotate the secret if the response with the secret was lost.
curl --request POST \
--url https://api.uselora.com/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"shortcut.created"
],
"url": "https://example.com/hooks/lora",
"description": "Sync to the intranet"
}
'import requests
url = "https://api.uselora.com/v1/webhooks"
payload = {
"events": ["shortcut.created"],
"url": "https://example.com/hooks/lora",
"description": "Sync to the intranet"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['shortcut.created'],
url: 'https://example.com/hooks/lora',
description: 'Sync to the intranet'
})
};
fetch('https://api.uselora.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.uselora.com/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'shortcut.created'
],
'url' => 'https://example.com/hooks/lora',
'description' => 'Sync to the intranet'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uselora.com/v1/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.uselora.com/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"shortcut.created\"\n ],\n \"url\": \"https://example.com/hooks/lora\",\n \"description\": \"Sync to the intranet\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabledReason": "manual",
"enabled": true,
"events": [
"shortcut.created"
],
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"source": "api",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>"
}{
"createdAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"disabledReason": "manual",
"enabled": true,
"events": [
"shortcut.created"
],
"id": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"previousSecretExpiresAt": "2023-11-07T05:31:56Z",
"source": "api",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"secret": "whsec_your_signing_secret"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>",
"reason": "not_a_url"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "plan_requires_upgrade",
"requestId": "<string>",
"traceId": "<string>",
"current_plan": "<string>",
"required_capability": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>",
"required_scope": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "payload_too_large",
"requestId": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"traceId": "<string>"
}{
"error": "<string>",
"code": "internal_error",
"requestId": "<string>",
"traceId": "<string>"
}Authorizations
Workspace API key (lora_sk_…) sent as Authorization: Bearer <api_key>. Each scoped operation names the scope it requires in its security requirement, for example shortcuts.write; a key without it receives 403 with code: insufficient_scope. GET /v1/qr also accepts anonymous requests and requires no scope.
Headers
Body
Payload to create a webhook endpoint.
The events the endpoint receives. An endpoint gets only events created after it was created, or after the event was added to this list: nothing is sent for the past.
1 - 3 elementsAn event type. shortcut.created: a visible shortcut was inserted, or a shortcut became visible to the workspace. shortcut.updated: a shortcut was updated. shortcut.deleted: a shortcut was removed, or left workspace visibility (made private or unlisted).
shortcut.created, shortcut.updated, shortcut.deleted The HTTPS URL that receives events. It must resolve to a public address: IP addresses, local names and private, loopback and link-local ranges are refused, and redirects are not followed. Each URL can be an endpoint once per workspace.
1 - 2048"https://example.com/hooks/lora"
Response
A retry of a request that already created an endpoint: that endpoint, without its secret.
The endpoint an earlier request with the same Idempotency-Key created. It carries no secret: rotate the secret if it was lost.
ISO 8601 creation time.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$The events the endpoint receives.
An event type. shortcut.created: a visible shortcut was inserted, or a shortcut became visible to the workspace. shortcut.updated: a shortcut was updated. shortcut.deleted: a shortcut was removed, or left workspace visibility (made private or unlisted).
shortcut.created, shortcut.updated, shortcut.deleted While a rotated secret still signs next to the new one, when it stops, ISO 8601; otherwise null.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$ISO 8601 time of the last change.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$Was this page helpful?