curl --request PATCH \
--url https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id} \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"enabled": true,
"url": "<string>",
"headers": {},
"subprotocols": [],
"connect_message": "<string>",
"conditions": [],
"dataset": "<string>"
}
'const options = {
method: 'PATCH',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
url: '<string>',
headers: {},
subprotocols: [],
connect_message: '<string>',
conditions: [],
dataset: '<string>'
})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id}"
payload = {
"name": "<string>",
"enabled": True,
"url": "<string>",
"headers": {},
"subprotocols": [],
"connect_message": "<string>",
"conditions": [],
"dataset": "<string>"
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"ws_trigger": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"conditions": [
{
"path": "<string>",
"op": "equals",
"value": "<unknown>"
}
],
"mappings": [
{}
],
"dataset": "<string>",
"status": "connected",
"last_event_at": "<string>",
"last_error": "<string>",
"created_at": "<string>"
}
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}Edit, pause or resume a WebSocket trigger
Change any of name, enabled, url, headers, subprotocols, connect_message, conditions and dataset (#177); each is checked as create checks it, conditions in the one dialect (#165). A change to the connection, the conditions or the dataset reconnects the listener, which reads them when it connects; a rename alone leaves the socket open. enabled false closes the socket and true opens it. The connection settings stay encrypted and are never returned. Moving url to a different host is refused unless the request also sends each stored headers / connect_message (null for none): credentials nobody can read back are never carried to a new host unseen.
curl --request PATCH \
--url https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id} \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"enabled": true,
"url": "<string>",
"headers": {},
"subprotocols": [],
"connect_message": "<string>",
"conditions": [],
"dataset": "<string>"
}
'const options = {
method: 'PATCH',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
url: '<string>',
headers: {},
subprotocols: [],
connect_message: '<string>',
conditions: [],
dataset: '<string>'
})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/ws-triggers/{ws_trigger_id}"
payload = {
"name": "<string>",
"enabled": True,
"url": "<string>",
"headers": {},
"subprotocols": [],
"connect_message": "<string>",
"conditions": [],
"dataset": "<string>"
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"ws_trigger": {
"id": "<string>",
"name": "<string>",
"enabled": true,
"conditions": [
{
"path": "<string>",
"op": "equals",
"value": "<unknown>"
}
],
"mappings": [
{}
],
"dataset": "<string>",
"status": "connected",
"last_event_at": "<string>",
"last_error": "<string>",
"created_at": "<string>"
}
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>"
}Authorizations
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.
Body
1 - 80true arms the listener socket; false tears it down.
Must start with ws:// or wss://. To a different host, send headers and connect_message too when the trigger has them stored.
Connection headers. Encrypted; never returned.
Sent once on connect (e.g. a subscribe frame).
Frame filter; an empty array matches every frame. Validated on save (#165) and stored in the full {path, op, value} form.
Show child attributes
Show child attributes
null or empty routes each frame by the project's rules. Validated as a dataset name.