---
title: "Propose a data read for a rule-finding app"
method: POST
path: "/v1/apps/{id}/mining/templates"
tags: ["Apps"]
---

# Propose a data read for a rule-finding app

`POST /v1/apps/{id}/mining/templates`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/apps/{id}/mining/templates`
- Auth: HTTP bearer

Records one read-only `SELECT` over a source connection as `pending`; a workspace owner must approve it before it runs. Idempotent on the statement text: proposing the same text again returns the existing read in whatever state it is. Refused with 422 when the statement is not a single read-only `SELECT`, when `key_column` is not one of `columns`, or when the app already holds the most reads allowed. Requires the `configure` access tier on the app.

## Path parameters

- `id` string, uuid, required

## Request body

- AppRulesTemplateInput
  - `name` string, required: The read's name
  - `connection_id` string, uuid, required: The source connection the read runs on.
  - `sql_text` string, required: One read-only `SELECT` statement.
  - `key_column` string, required: The column that identifies each record; must be one of `columns` when those are given.
  - `columns` string[]: The columns the read returns.
  - `watermark_column` string: A column that orders records by change.
  - `max_rows` integer: Most rows one run of the read returns; the deployment default when omitted.
  - `feature_row` boolean: True when the read returns one flat row per record
  - `params_schema` object: JSON Schema of the read's parameters.

## Response `201`

The proposed read (or the existing one with the same text).

- AppRulesTemplate: One data read a rule-finding app may run over a source connection once approved.
  - `id` string, uuid
  - `app_id` string, uuid
  - `name` string
  - `connection_id` string, uuid
  - `sql_text` string
  - `sql_hash` string: Hex SHA-256 of the statement; a changed statement is a new read and needs a new approval.
  - `params_schema` object, nullable
  - `key_column` string
  - `columns` string[], nullable
  - `watermark_column` string, nullable
  - `max_rows` integer
  - `feature_row` boolean
  - `state` 'pending' | 'approved' | 'revoked'
  - `proposed_by` string, nullable
  - `proposed_in_round` string, uuid, nullable
  - `approved_by` string, nullable
  - `approved_at` string, date-time, nullable
  - `created_at` string, date-time

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `404`: The requested resource was not found.
- `422`: The request is well-formed but violates the declared task contract.
- `429`: Daily rate limit exceeded.

## Changes

- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/apps/:id/mining/templates/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
