Test conditions and mappings against a sample payload
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules/test \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"payload": "<unknown>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{}
]
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: '<unknown>',
conditions: [{path: '<string>', value: '<unknown>', equals: '<unknown>'}],
mappings: [{}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules/test', 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/test"
payload = {
"payload": "<unknown>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [{}]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"matched": true,
"record": {}
}{
"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
Test conditions and mappings against a sample payload
Whether these conditions match the payload and what the mappings would store, evaluated by the same engine ingest uses. Validated exactly as a save is; nothing is written. Readable by any role. The console’s rule editor calls it (ING-12, #201).
POST
/
admin
/
api
/
projects
/
{pid}
/
rules
/
test
Test conditions and mappings against a sample payload
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules/test \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"payload": "<unknown>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [
{}
]
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: '<unknown>',
conditions: [{path: '<string>', value: '<unknown>', equals: '<unknown>'}],
mappings: [{}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules/test', 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/test"
payload = {
"payload": "<unknown>",
"conditions": [
{
"path": "<string>",
"value": "<unknown>",
"equals": "<unknown>"
}
],
"mappings": [{}]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"matched": true,
"record": {}
}{
"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.
Headers
Makes a POST safe to retry for 24 hours: the same key, credential, path and body returns the stored response (Idempotent-Replayed: true) instead of running again. 422 if the key was used for a different request; 409 while the first is in flight.
Required string length:
1 - 255Path Parameters
Project id (UUID) belonging to the caller workspace.
Body
application/json