curl --request POST \
--url https://api.uselora.com/v1/webhooks/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "shortcut.created"
}
'import requests
url = "https://api.uselora.com/v1/webhooks/{id}/test"
payload = { "event": "shortcut.created" }
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({event: 'shortcut.created'})
};
fetch('https://api.uselora.com/v1/webhooks/{id}/test', 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/{id}/test",
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([
'event' => 'shortcut.created'
]),
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/{id}/test"
payload := strings.NewReader("{\n \"event\": \"shortcut.created\"\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/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"shortcut.created\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks/{id}/test")
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 \"event\": \"shortcut.created\"\n}"
response = http.request(request)
puts response.read_body{
"attemptCount": 0,
"attempts": [
{
"durationMs": 0,
"id": "<string>",
"number": 0,
"outcome": "succeeded",
"responseExcerpt": "<string>",
"responseStatus": 0,
"startedAt": "2023-11-07T05:31:56Z",
"trigger": "scheduled"
}
],
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"endpointId": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"event": "shortcut.created",
"eventId": "evt_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"id": "0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"lastError": "<string>",
"nextAttemptAt": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"status": "pending"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>"
}{
"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>"
}Send a test event
Sends a sample event to the endpoint now and returns the delivery with its attempt, so you can see what your receiver answered. Needs the Business plan or above. Limited to 10 a minute per endpoint. An endpoint made by an integration (source: subscription) is not found here.
The event has an ID starting with evt_test_, carries a fixed example shortcut (the Retrieve a sample event operation shows the same content), and is signed and sent like any other event. It is tried once, with no retries; it never counts towards disabling the endpoint, and it is sent even if the endpoint is switched off. The delivery appears in the endpoint’s list of deliveries. If Lora’s sender is busy with other deliveries of the endpoint, the delivery can still be pending when this answers.
The body may be left out; the default event is shortcut.created.
curl --request POST \
--url https://api.uselora.com/v1/webhooks/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "shortcut.created"
}
'import requests
url = "https://api.uselora.com/v1/webhooks/{id}/test"
payload = { "event": "shortcut.created" }
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({event: 'shortcut.created'})
};
fetch('https://api.uselora.com/v1/webhooks/{id}/test', 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/{id}/test",
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([
'event' => 'shortcut.created'
]),
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/{id}/test"
payload := strings.NewReader("{\n \"event\": \"shortcut.created\"\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/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"shortcut.created\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselora.com/v1/webhooks/{id}/test")
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 \"event\": \"shortcut.created\"\n}"
response = http.request(request)
puts response.read_body{
"attemptCount": 0,
"attempts": [
{
"durationMs": 0,
"id": "<string>",
"number": 0,
"outcome": "succeeded",
"responseExcerpt": "<string>",
"responseStatus": 0,
"startedAt": "2023-11-07T05:31:56Z",
"trigger": "scheduled"
}
],
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"endpointId": "wh_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"event": "shortcut.created",
"eventId": "evt_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"id": "0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f",
"lastError": "<string>",
"nextAttemptAt": "2023-11-07T05:31:56Z",
"outcome": "<string>",
"status": "pending"
}{
"error": "<string>",
"requestId": "<string>",
"code": "<string>",
"fieldErrors": {},
"traceId": "<string>"
}{
"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.
Path Parameters
Body
Response
The test delivery, with its attempt. A receiver that answered with an error, or did not answer, is not an error of this request: look at the delivery's status and its attempt.
One event on its way to one endpoint, with every attempt made. Deliveries are listed for 30 days.
When the delivery ended, or null while it is pending.
^(?:(?:\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))$When the delivery was queued, ISO 8601.
^(?:(?:\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 event's unique ID. A real event uses evt_ and a UUID, a test send evt_test_ and a UUID, and a sample from the sample operation evt_sample_ and the event name. The same for every delivery, retry and resend of the event. Deduplicate on it, or on the webhook-id header, which carries the same value.
"evt_0198f2a4-7c1b-7d3e-9a52-3f6b1c2d4e5f"
When the next attempt is due, while the delivery is pending.
^(?:(?:\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))$pending: waiting for an attempt or a retry. succeeded: the receiver answered 2xx. failed: ended without success, because retries ran out or the failure cannot be retried. skipped: not sent, because the shortcut is private, unlisted or deleted by now, the endpoint is off, or the plan no longer includes webhooks. canceled: the endpoint's URL changed, an event type was removed from it, or it was turned off or deleted. quarantined: Lora stopped processing the delivery after repeated internal errors. expired: reserved; webhook endpoints do not use it today.
pending, succeeded, failed, skipped, canceled, expired, quarantined Was this page helpful?