> ## Documentation Index
> Fetch the complete documentation index at: https://docs.finwatch.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Instruction

> Retrieves a specific instruction by its ID. Returns the full instruction object including the Watchscript source text and compiled DSL JSON.



## OpenAPI

````yaml GET /instructions/{id}
openapi: 3.1.0
info:
  title: FinWatch API
  description: >-
    FinWatch REST API for real-time transaction monitoring, rule evaluation, and
    instruction management.
  version: 1.0.0
  contact:
    name: FinWatch Support
    url: https://docs.finwatch.finance
servers:
  - url: http://localhost:8081
    description: Local development server
security: []
tags:
  - name: Transactions
    description: >-
      Inject transactions for evaluation, retrieve transaction details, and
      handle webhook events.
  - name: Instructions
    description: >-
      Create, list, retrieve, and delete monitoring rules written in
      Watchscript.
  - name: Git
    description: Manage rules with Git for version control — status, pull, push, and clone.
paths:
  /instructions/{id}:
    get:
      tags:
        - Instructions
      summary: Get Instruction
      description: >-
        Retrieves a specific instruction by its ID. Returns the full instruction
        object including the Watchscript source text and compiled DSL JSON.
      operationId: getInstruction
      parameters:
        - name: id
          in: path
          required: true
          description: The instruction ID (integer)
          schema:
            type: integer
          example: 1
      responses:
        '200':
          description: Instruction retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instruction'
              example:
                id: 1
                name: HighValueTransaction
                text: |-
                  rule HighValueTransaction {
                      description "Review any transaction above $10,000"
                      when amount > 10000
                      then review
                           score   0.5
                           reason  "Amount exceeds threshold"
                  }
                description: Review any transaction above $10,000
                dsl_json: '{"name":"HighValueTransaction","when":[...],"then":{...}}'
                created_at: '2024-01-15T10:00:00Z'
                updated_at: '2024-01-15T10:00:00Z'
        '400':
          description: Invalid instruction ID format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Instruction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed to retrieve instruction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Instruction:
      type: object
      properties:
        id:
          type: integer
          description: Unique instruction identifier
        name:
          type: string
          description: Rule name (extracted from Watchscript)
        text:
          type: string
          description: The original Watchscript source text
        description:
          type: string
          description: Human-readable description (extracted from Watchscript)
        dsl_json:
          type: string
          description: Compiled DSL as JSON string (AST representation)
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code

````