HydraCore
API by router

Rule templates

List Templates

GET
/v1/rule-templates

Authorization

HTTPBearer
headerAuthorizationBearer <token>

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/rule-templates'
Example Response
[  {    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "is_active": true,    "name": "string",    "rules": [      {}    ],    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",    "updated_at": "2019-08-24T14:15:22Z",    "version": 0  }]

Create Template

POST
/v1/rule-templates

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
description?string|null
name*Name
Lengthlength <= 200
rules*array<>

Response Body

Successful Response

application/json
  1. response
created_at*Created At
Formatdate-time
description*string|null
id*Id
Formatuuid
is_active*Is Active
name*Name
rules*array<>
tenant_id*Tenant Id
Formatuuid
updated_at*Updated At
Formatdate-time
version*Version
Example Request
curl -X POST 'https://example.com/v1/rule-templates' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "rules": [    {      "name": "string",      "trigger_event": "string"    }  ]}'
Example Response
{  "created_at": "2019-08-24T14:15:22Z",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "is_active": true,  "name": "string",  "rules": [    {}  ],  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}

Get Template

GET
/v1/rule-templates/{template_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

template_id*Template Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

application/json
  1. response
created_at*Created At
Formatdate-time
description*string|null
id*Id
Formatuuid
is_active*Is Active
name*Name
rules*array<>
tenant_id*Tenant Id
Formatuuid
updated_at*Updated At
Formatdate-time
version*Version
Example Request
curl -X GET 'https://example.com/v1/rule-templates/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "created_at": "2019-08-24T14:15:22Z",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "is_active": true,  "name": "string",  "rules": [    {}  ],  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}

Delete Template

DELETE
/v1/rule-templates/{template_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

template_id*Template Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Response Body

Successful Response

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

Update Template

PUT
/v1/rule-templates/{template_id}

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

template_id*Template Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
description?string|null
is_active?boolean|null
name?string|null
rules?array<>|null

Response Body

Successful Response

application/json
  1. response
created_at*Created At
Formatdate-time
description*string|null
id*Id
Formatuuid
is_active*Is Active
name*Name
rules*array<>
tenant_id*Tenant Id
Formatuuid
updated_at*Updated At
Formatdate-time
version*Version
Example Request
curl -X PUT 'https://example.com/v1/rule-templates/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "created_at": "2019-08-24T14:15:22Z",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "is_active": true,  "name": "string",  "rules": [    {}  ],  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}

List Applications

GET
/v1/rule-templates/{template_id}/applications

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

template_id*Template Id
Formatuuid

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/rule-templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/applications'
Example Response
[  {    "applied_at": "2019-08-24T14:15:22Z",    "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",    "template_version": 0  }]

Apply Template

POST
/v1/rule-templates/{template_id}/apply

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

template_id*Template Id
Formatuuid

Header Parameters

X-Api-Key?string|null

Request Body

application/json
  1. body
customer_id*Customer Id
Formatuuid

Response Body

Successful Response

application/json
  1. response
customer_id*Customer Id
Formatuuid
rules_created*Rules Created
rules_skipped*Rules Skipped
template_id*Template Id
Formatuuid
Example Request
curl -X POST 'https://example.com/v1/rule-templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/apply' \  -H 'Content-Type: application/json' \  -d '{  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e"}'
Example Response
{  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "rules_created": 0,  "rules_skipped": 0,  "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc"}