Get Rule
GET /api/v1/rules/:id
Returns a single rule by ID.
Path Parameters
| Parameter | Type | Description |
|---|
| id | string | Rule ID |
Query Parameters
| Parameter | Type | Default | Description |
|---|
| fields | string | all | Comma-separated field names |
Example Request
curl -X GET "https://statements.finopsbricks.com/api/v1/rules/rule123xyz" \
-H "api-key: fob_stm_xxxxxxxxxxxx" \
-H "api-secret: xxxxxxxxxxxxxxxx"
Response
{
"data": {
"id": "rule123xyz",
"name": "Categorize Salary",
"description": "Auto-categorize salary payments",
"priority": 10,
"conditions": [
{
"field": "particulars",
"operator": "contains",
"value": "SALARY"
}
],
"actions": [
{
"field": "category",
"value": "income"
},
{
"field": "entity",
"value": "Employer Inc"
}
],
"enabled": true,
"created_at": "2025-01-01T00:00:00.000Z"
}
}
Response Fields
See Rule Object for field descriptions.
Errors
| Code | Description |
|---|
| 401 | Invalid or missing API credentials |
| 403 | API key lacks rules:read permission |
| 404 | Rule not found |