Update a rule
curl --request PATCH \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules/{id} \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"enabled": true,
"name": "<string>",
"dataset": "<string>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
'const options = {
method: 'PATCH',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: '<string>',
dataset: '<string>',
conditions: [{path: '<string>', value: '<unknown>', equals: '<unknown>'}],
mappings: [{path: '<string>', key: '<string>'}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules/{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/{pid}/rules/{id}"
payload = {
"enabled": True,
"name": "<string>",
"dataset": "<string>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"rule": {
"id": "<string>",
"name": "<string>",
"enabled": 0,
"conditions": "<string>",
"dataset": "<string>",
"mappings": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"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>"
}Rules
Update a rule
Change any of enabled, name, dataset, conditions and mappings in place (ING-12, #201); it used to toggle enabled only. Send only what changes; the result is validated as a create is. Top-level alias: PATCH /admin/api/rules/. Write role required.
PATCH
/
admin
/
api
/
projects
/
{pid}
/
rules
/
{id}
Update a rule
curl --request PATCH \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules/{id} \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"enabled": true,
"name": "<string>",
"dataset": "<string>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
'const options = {
method: 'PATCH',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
name: '<string>',
dataset: '<string>',
conditions: [{path: '<string>', value: '<unknown>', equals: '<unknown>'}],
mappings: [{path: '<string>', key: '<string>'}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules/{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/{pid}/rules/{id}"
payload = {
"enabled": True,
"name": "<string>",
"dataset": "<string>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"rule": {
"id": "<string>",
"name": "<string>",
"enabled": 0,
"conditions": "<string>",
"dataset": "<string>",
"mappings": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"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
sessionbearerAuthapiKey
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.
Path Parameters
Project id (UUID) belonging to the caller workspace.
Rule id.
Body
application/json