Subscribe to an event
curl --request POST \
--url https://app.myhero.so/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetUrl": "<string>",
"workspaceId": "<string>",
"projectIds": "<string>",
"projectId": "<string>",
"tableIds": "<string>",
"tableId": "<string>"
}
'import requests
url = "https://app.myhero.so/subscription"
payload = {
"targetUrl": "<string>",
"workspaceId": "<string>",
"projectIds": "<string>",
"projectId": "<string>",
"tableIds": "<string>",
"tableId": "<string>"
}
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({
targetUrl: '<string>',
workspaceId: '<string>',
projectIds: '<string>',
projectId: '<string>',
tableIds: '<string>',
tableId: '<string>'
})
};
fetch('https://app.myhero.so/subscription', 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://app.myhero.so/subscription",
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([
'targetUrl' => '<string>',
'workspaceId' => '<string>',
'projectIds' => '<string>',
'projectId' => '<string>',
'tableIds' => '<string>',
'tableId' => '<string>'
]),
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://app.myhero.so/subscription"
payload := strings.NewReader("{\n \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\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://app.myhero.so/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.myhero.so/subscription")
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 \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>",
"event": "row.created",
"targetUrl": "<string>",
"workspaceId": "<string>",
"createdAt": 123,
"failureCount": 123,
"secret": "<string>",
"projectIds": [
"<string>"
],
"tableIds": [
"<string>"
],
"lastDeliveredAt": 123,
"isDisabled": true
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<unknown>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<unknown>"
]
}Subscriptions
Subscribe to an event
Registers a URL to be POSTed whenever the named event happens in the workspace.
Built for REST Hook integrations that create and destroy subscriptions as users enable and disable their automations.
Returns the subscription id, which is what unsubscribes it, and a secret shown only here: every delivery carries X-Hero-Signature: t=<unix seconds>,v1=<hex>, the HMAC-SHA256 of <t>.<raw body> under that secret.
POST
/
subscription
Subscribe to an event
curl --request POST \
--url https://app.myhero.so/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetUrl": "<string>",
"workspaceId": "<string>",
"projectIds": "<string>",
"projectId": "<string>",
"tableIds": "<string>",
"tableId": "<string>"
}
'import requests
url = "https://app.myhero.so/subscription"
payload = {
"targetUrl": "<string>",
"workspaceId": "<string>",
"projectIds": "<string>",
"projectId": "<string>",
"tableIds": "<string>",
"tableId": "<string>"
}
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({
targetUrl: '<string>',
workspaceId: '<string>',
projectIds: '<string>',
projectId: '<string>',
tableIds: '<string>',
tableId: '<string>'
})
};
fetch('https://app.myhero.so/subscription', 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://app.myhero.so/subscription",
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([
'targetUrl' => '<string>',
'workspaceId' => '<string>',
'projectIds' => '<string>',
'projectId' => '<string>',
'tableIds' => '<string>',
'tableId' => '<string>'
]),
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://app.myhero.so/subscription"
payload := strings.NewReader("{\n \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\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://app.myhero.so/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.myhero.so/subscription")
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 \"targetUrl\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectIds\": \"<string>\",\n \"projectId\": \"<string>\",\n \"tableIds\": \"<string>\",\n \"tableId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"_id": "<string>",
"event": "row.created",
"targetUrl": "<string>",
"workspaceId": "<string>",
"createdAt": 123,
"failureCount": 123,
"secret": "<string>",
"projectIds": [
"<string>"
],
"tableIds": [
"<string>"
],
"lastDeliveredAt": 123,
"isDisabled": true
}
}{
"error": "<string>",
"message": "<string>",
"details": [
"<unknown>"
]
}{
"error": "<string>",
"message": "<string>",
"details": [
"<unknown>"
]
}Authorizations
HERO personal access token
Body
application/json
Available options:
row.created, row.updated, row.deleted, cell.changed, clause.added, clause.edited, clause.deleted, term.defined, term.removed, signature.signed, document.fullySigned, document.signaturesVoided, document.created, document.updated, document.moved, document.published, document.duplicated, document.deleted, document.renamed, document.newVersion, document.restoreVersion, workspace.memberJoined, workspace.memberLeft, document.collaboratorAdded, document.collaboratorRemoved, table.created, table.deleted, column.added, column.deleted, project.created Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Response
201 response
Show child attributes
Show child attributes