Define an event type
curl --request PUT \
--url https://lazyapp.in/v1/event-definitions/{type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
}
}
'import requests
url = "https://lazyapp.in/v1/event-definitions/{type}"
payload = {
"name": "<string>",
"description": "<string>",
"schema": {
"required": ["<string>"],
"properties": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
schema: {required: ['<string>'], properties: {}}
})
};
fetch('https://lazyapp.in/v1/event-definitions/{type}', 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://lazyapp.in/v1/event-definitions/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'schema' => [
'required' => [
'<string>'
],
'properties' => [
]
]
]),
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://lazyapp.in/v1/event-definitions/{type}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://lazyapp.in/v1/event-definitions/{type}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/event-definitions/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "real_estate.visit_booked",
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
},
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "real_estate.visit_booked",
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
},
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Events
Define an event type
Creates or replaces a workspace event type, so POST /v1/events accepts it and checks its properties. Idempotent by type, and brings an archived type back. Namespace your types (clinic.appointment_booked) so several products can share a workspace.
Required scope: templates:write
PUT
/
v1
/
event-definitions
/
{type}
Define an event type
curl --request PUT \
--url https://lazyapp.in/v1/event-definitions/{type} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
}
}
'import requests
url = "https://lazyapp.in/v1/event-definitions/{type}"
payload = {
"name": "<string>",
"description": "<string>",
"schema": {
"required": ["<string>"],
"properties": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
schema: {required: ['<string>'], properties: {}}
})
};
fetch('https://lazyapp.in/v1/event-definitions/{type}', 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://lazyapp.in/v1/event-definitions/{type}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'schema' => [
'required' => [
'<string>'
],
'properties' => [
]
]
]),
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://lazyapp.in/v1/event-definitions/{type}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://lazyapp.in/v1/event-definitions/{type}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/event-definitions/{type}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {\n \"required\": [\n \"<string>\"\n ],\n \"properties\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "real_estate.visit_booked",
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
},
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "real_estate.visit_booked",
"name": "<string>",
"description": "<string>",
"schema": {
"required": [
"<string>"
],
"properties": {}
},
"archived": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Headers
Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.
Maximum string length:
255Path Parameters
Lower-case words joined by dots, such as real_estate.visit_booked.
Maximum string length:
64Pattern:
^[a-z0-9_]+(\.[a-z0-9_]+)+$Body
application/json
Response
Replaced.