Instructions
Compile and save instruction
Compile a Watch DSL script and persist it as an instruction for transaction evaluation.
POST
/
compile-and-save-instruction
curl -X POST http://localhost:8081/compile-and-save-instruction \
-H "Content-Type: application/json" \
-d '{
"script": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}"
}'
{
"id": 1,
"name": "HighValueTransaction",
"text": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}",
"description": "Review any transaction above $10,000",
"dsl_json": "{\"name\":\"HighValueTransaction\",\"when\":[...],\"then\":{...}}",
"created_at": "2026-03-16T10:00:00Z",
"updated_at": "2026-03-16T10:00:00Z"
}
Missing required field: script cannot be empty
Failed to save instruction: An instruction with name 'HighValueTransaction' already exists.
Failed to compile script: ...
Blnk Watch is currently in beta. Send us a message
Body
string
required
The Watch DSL script to compile. The rule name is extracted from the script and must be unique across instructions.
curl -X POST http://localhost:8081/compile-and-save-instruction \
-H "Content-Type: application/json" \
-d '{
"script": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}"
}'
{
"id": 1,
"name": "HighValueTransaction",
"text": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}",
"description": "Review any transaction above $10,000",
"dsl_json": "{\"name\":\"HighValueTransaction\",\"when\":[...],\"then\":{...}}",
"created_at": "2026-03-16T10:00:00Z",
"updated_at": "2026-03-16T10:00:00Z"
}
Missing required field: script cannot be empty
Failed to save instruction: An instruction with name 'HighValueTransaction' already exists.
Failed to compile script: ...
Response fields
integer
Auto-generated instruction ID. Use this with get instruction and delete instruction.
string
Unique rule name extracted from the DSL script.
string
Original Watch DSL script text.
string
Rule description from the DSL script, if provided.
string
Compiled rule JSON used during transaction evaluation.
string
ISO 8601 timestamp of when the instruction was created.
string
ISO 8601 timestamp of when the instruction was last updated.
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.Was this page helpful?
⌘I
curl -X POST http://localhost:8081/compile-and-save-instruction \
-H "Content-Type: application/json" \
-d '{
"script": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}"
}'
{
"id": 1,
"name": "HighValueTransaction",
"text": "rule HighValueTransaction {\n description \"Review any transaction above $10,000\"\n when amount > 10000\n then review\n score 0.5\n reason \"Amount exceeds threshold\"\n}",
"description": "Review any transaction above $10,000",
"dsl_json": "{\"name\":\"HighValueTransaction\",\"when\":[...],\"then\":{...}}",
"created_at": "2026-03-16T10:00:00Z",
"updated_at": "2026-03-16T10:00:00Z"
}
Missing required field: script cannot be empty
Failed to save instruction: An instruction with name 'HighValueTransaction' already exists.
Failed to compile script: ...