HydraCore
API by router

Rules

List Rules

GET
/v1/rules

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Query Parameters

instance_id?|null
active_only?Active Only
Defaultfalse

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://example.com/v1/rules'
Example Response
[  {    "actions": [      {}    ],    "conditions": [      {}    ],    "cooldown_seconds": 0,    "created_at": "2019-08-24T14:15:22Z",    "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",    "description": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",    "is_active": true,    "last_triggered_at": "2019-08-24T14:15:22Z",    "name": "string",    "priority": 0,    "rule_key": "string",    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",    "trigger_count": 0,    "trigger_event": "string",    "updated_at": "2019-08-24T14:15:22Z"  }]

Create Rule

POST
/v1/rules

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
actions?array<>
Items1 <= items
conditions?array<>
cooldown_seconds?Cooldown Seconds
Range0 <= value
Default300
customer_id?|

NULL = tenant-wide, set = customer-specific

description?string|null
instance_id?|null
is_active?Is Active
Defaulttrue
name*Name
Length1 <= length <= 200
priority?Priority
Range0 <= value
Default0
rule_key?|

Override key — same key suppresses tenant rule

trigger_event*Trigger Event

Response Body

Successful Response

application/json
  1. response
actions*array<>
conditions*array<>
cooldown_seconds*Cooldown Seconds
created_at*Created At
Formatdate-time
customer_id?|null
description*string|null
id*Id
Formatuuid
instance_id*|null
is_active*Is Active
last_triggered_at*|null
name*Name
priority*Priority
rule_key?string|null
tenant_id*Tenant Id
Formatuuid
trigger_count*Trigger Count
trigger_event*Trigger Event
updated_at*Updated At
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/rules' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "trigger_event": "string"}'
Example Response
{  "actions": [    {}  ],  "conditions": [    {}  ],  "cooldown_seconds": 0,  "created_at": "2019-08-24T14:15:22Z",  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",  "is_active": true,  "last_triggered_at": "2019-08-24T14:15:22Z",  "name": "string",  "priority": 0,  "rule_key": "string",  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "trigger_count": 0,  "trigger_event": "string",  "updated_at": "2019-08-24T14:15:22Z"}

List Replayable Services

GET
/v1/rules/replayable-services

Response Body

Successful Response

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://example.com/v1/rules/replayable-services'
Example Response200
[  {}]

List Trigger Types

GET
/v1/rules/trigger-types

Response Body

Successful Response

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://example.com/v1/rules/trigger-types'
Example Response200
[  {    "description": "string",    "event": "string",    "label": "string",    "payload_fields": [      {}    ]  }]

Get Rule

GET
/v1/rules/{rule_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

rule_id*Rule Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

application/json
  1. response
actions*array<>
conditions*array<>
cooldown_seconds*Cooldown Seconds
created_at*Created At
Formatdate-time
customer_id?|null
description*string|null
id*Id
Formatuuid
instance_id*|null
is_active*Is Active
last_triggered_at*|null
name*Name
priority*Priority
rule_key?string|null
tenant_id*Tenant Id
Formatuuid
trigger_count*Trigger Count
trigger_event*Trigger Event
updated_at*Updated At
Formatdate-time
Example Request
curl -X GET 'https://example.com/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "actions": [    {}  ],  "conditions": [    {}  ],  "cooldown_seconds": 0,  "created_at": "2019-08-24T14:15:22Z",  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",  "is_active": true,  "last_triggered_at": "2019-08-24T14:15:22Z",  "name": "string",  "priority": 0,  "rule_key": "string",  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "trigger_count": 0,  "trigger_event": "string",  "updated_at": "2019-08-24T14:15:22Z"}

Update Rule

PATCH
/v1/rules/{rule_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

rule_id*Rule Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
actions?array<>|null
conditions?array<>|null
cooldown_seconds?|null
customer_id?|null
description?string|null
instance_id?|null
is_active?boolean|null
name?|null
priority?|null
rule_key?|null
trigger_event?string|null

Response Body

Successful Response

application/json
  1. response
actions*array<>
conditions*array<>
cooldown_seconds*Cooldown Seconds
created_at*Created At
Formatdate-time
customer_id?|null
description*string|null
id*Id
Formatuuid
instance_id*|null
is_active*Is Active
last_triggered_at*|null
name*Name
priority*Priority
rule_key?string|null
tenant_id*Tenant Id
Formatuuid
trigger_count*Trigger Count
trigger_event*Trigger Event
updated_at*Updated At
Formatdate-time
Example Request
curl -X PATCH 'https://example.com/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "actions": [    {}  ],  "conditions": [    {}  ],  "cooldown_seconds": 0,  "created_at": "2019-08-24T14:15:22Z",  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "instance_id": "06587974-2dbe-4e10-8bf9-38cce0f5a366",  "is_active": true,  "last_triggered_at": "2019-08-24T14:15:22Z",  "name": "string",  "priority": 0,  "rule_key": "string",  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "trigger_count": 0,  "trigger_event": "string",  "updated_at": "2019-08-24T14:15:22Z"}

Delete Rule

DELETE
/v1/rules/{rule_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

rule_id*Rule Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

Example Request
curl -X DELETE 'https://example.com/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
Empty

Test Rule

POST
/v1/rules/{rule_id}/test

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

rule_id*Rule Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body

Dry-run test: provide a sample payload and see which conditions match.

payload*

Sample event payload to test against

Response Body

Successful Response

application/json
  1. response
actions_that_would_fire*array<>
all_conditions_met*All Conditions Met
condition_results*array<>
rule_id*Rule Id
Formatuuid
rule_name*Rule Name
Example Request
curl -X POST 'https://example.com/v1/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08/test' \  -H 'Content-Type: application/json' \  -d '{  "payload": {}}'
Example Response
{  "actions_that_would_fire": [    {}  ],  "all_conditions_met": true,  "condition_results": [    {}  ],  "rule_id": "728c1541-d6d1-4290-9a53-cdf01dd32d60",  "rule_name": "string"}