Create a mapping rule
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"dataset": "<string>",
"enabled": true,
"conditions": [
{
"path": "<string>",
"equals": "<string>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dataset: '<string>',
enabled: true,
conditions: [{path: '<string>', equals: '<string>'}],
mappings: [{path: '<string>', key: '<string>'}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules', 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"
payload = {
"name": "<string>",
"dataset": "<string>",
"enabled": True,
"conditions": [
{
"path": "<string>",
"equals": "<string>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Rules
Create a mapping rule
Top-level alias: POST /admin/api/rules. Write role required.
POST
/
admin
/
api
/
projects
/
{pid}
/
rules
Create a mapping rule
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{pid}/rules \
--header 'Content-Type: application/json' \
--cookie hookie_session= \
--data '
{
"name": "<string>",
"dataset": "<string>",
"enabled": true,
"conditions": [
{
"path": "<string>",
"equals": "<string>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {cookie: 'hookie_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
dataset: '<string>',
enabled: true,
conditions: [{path: '<string>', equals: '<string>'}],
mappings: [{path: '<string>', key: '<string>'}]
})
};
fetch('https://app.hookie.ai/admin/api/projects/{pid}/rules', 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"
payload = {
"name": "<string>",
"dataset": "<string>",
"enabled": True,
"conditions": [
{
"path": "<string>",
"equals": "<string>"
}
],
"mappings": [
{
"path": "<string>",
"key": "<string>"
}
]
}
headers = {
"cookie": "hookie_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>"
}Authorizations
sessionbearerAuth
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.
Body
application/json
Trimmed before storing; must be non-empty and at most 80 characters.
Required string length:
1 - 80The logical table matched events land in.
Pattern:
^[A-Za-z][A-Za-z0-9_]{0,62}$Anything other than the literal false is treated as true.
Omitted, null or empty means match every event. All conditions must hold.
Maximum array length:
10Show child attributes
Show child attributes
Omitted, null or empty means identity - store the whole payload.
Maximum array length:
50Show child attributes
Show child attributes
Response
Created.