---
title: "Get template by ID"
method: GET
path: "/v4/templates/{templateId}"
tags: ["Templates"]
---

# Get template by ID

`GET /v4/templates/{templateId}`

## Request

- Base URL: `https://api.kadoa.com`
- URL: `https://api.kadoa.com/v4/templates/{templateId}`
- Auth: API key in header `x-api-key`

Retrieve a template with all its published versions

## Path parameters

- `templateId` string, uuid, required

## Response `200`

200

- TemplateDetailResponseBody: Response wrapper for template detail
  - `error` false, required: Error flag (always false on success)
  - `data` object, required: Template with versions
    - `id` string, uuid, required: Template ID
    - `name` string, required: Template name
    - `description` string, nullable, required: Template description
    - `teamId` string, uuid, required: Owning team ID
    - `latestVersion` number, nullable, required: Latest published version number
    - `workflowCount` number: Number of workflows linked to this template
    - `latestVersionSummary` LatestVersionSummary: Content preview of the latest version for list rendering. null when the template has no published versions; omitted by create/update/duplicate responses.
      - `promptPreview` string, nullable, required: Truncated prompt prefix (capped at ~280 chars with ellipsis) for list display. null when the latest version has no prompt.
      - `schemaFieldNames` string[], required: Field names of the latest version's schema, in declared order. Empty when the version has no schema.
      - `dqRuleCount` integer, required: Count of data-quality rule fields on the latest version (top-level keys of schemaValidationRules, which are field names).
      - `notificationChannelCount` integer, required: Count of distinct notification channels across all events on the latest version.
      - `frequencyInterval` 'ONLY_ONCE' | 'EVERY_10_MINUTES' | 'EVERY_20_MINUTES' | 'HALF_HOURLY' | 'HOURLY' | 'TWO_HOURLY' | 'THREE_HOURLY' | 'FOUR_HOURLY' | 'SIX_HOURLY' | 'TWELVE_HOURLY' | 'EIGHTEEN_HOURLY' | 'DAILY' | 'TWO_DAY' | 'THREE_DAY' | 'WEEKLY' | 'BIWEEKLY' | 'TRIWEEKLY' | 'FOUR_WEEKS' | 'MONTHLY' | 'CUSTOM', nullable, required: Frequency interval enum of the latest version. null when the version does not control frequency.
      - `frequencyWeekdaysOnly` boolean, required: Whether the latest version skips Saturday and Sunday runs.
    - `archivedAt` string, nullable, required: Archive timestamp (null if active)
    - `createdAt` string, required: Creation timestamp
    - `updatedAt` string, required: Last update timestamp
    - `versions` object[], required: All published versions
      - `id` string, uuid, required: Version row ID
      - `templateId` string, uuid, required: Parent template ID
      - `version` number, required: Version number
      - `name` string, nullable, required: Custom display name (null = default 'v.N')
      - `publisher` object, required: Publisher attribution
        - `kind` 'HUMAN' | 'SERVICE_ACCOUNT' | 'AGENT' | 'SYSTEM', nullable, required: Publisher kind; null for legacy/unproven versions
        - `label` string, required: Current human name/email, non-human publisher label, or Unknown for legacy/unproven versions
      - `prompt` string, nullable, required: User prompt
      - `schemaId` string, uuid, nullable, required: Referenced data_schemas ID
      - `schemaFields` object[], nullable: Resolved schema fields from data_schemas
        - `mapper` 'jobDescription' | 'categoryClassifier' | 'taxonomyMapping' | 'stableUniqueId' | 'linkExtraction' | 'additionalData' | 'categorize': Function that produces this field's value.
        - `mapperConfig` object: Configuration for the selected mapper.
        - `name` string, required: Field name
        - `description` string: Human-readable field description shown in Kadoa
        - `instruction` string: Optional field-specific AI instruction for extraction guidance
        - `fieldType` string: Field role (SCHEMA or CLASSIFICATION)
        - `example` unknown
        - `shape` unknown
        - `dataType` string: Output data type for SCHEMA fields. Use public values such as STRING, NUMBER, BOOLEAN, DATE, DATETIME, MONEY, IMAGE, LINK, OBJECT, or ARRAY.
        - `isKey` boolean: Marks this field as part of the record's primary key. Key fields define row identity across runs and enable data linking (records with the same key values are treated as the same record over time, used for dedupe and change detection). Set true ONLY when the complete key tuple uniquely identifies a logical output record and every component is stable across runs and reliably present (not nullable/missing). Key fields should be scalar STRING, NUMBER, or LINK fields; avoid structured, semantic, boolean, image, and timestamp/date fields as keys. Good candidates: external IDs, SKUs, canonical URLs, posting IDs. Bad candidates: prices, counts, timestamps, free-text titles/descriptions, or anything that can change between runs. Multiple fields may form a composite key; uniqueness applies to their combination, not each component. For derived rows, source-backed grouping dimensions and a deterministic output discriminator may identify the result; measured values and explanations do not. If no supported key tuple satisfies these guarantees, leave isKey unset on every field — data linking will simply be disabled, which is preferable to a wrong key. Choosing a non-stable or non-unique key causes duplicate rows and missed updates.
        - `categories` object[]: Predefined categories for CLASSIFICATION fields
          - `title` string, required: Short title/label of the category
          - `definition` string, required: Full definition/description of the category
      - `schemaValidationRules` object, nullable: Schema validation rules for this version
      - `notifications` object[]
        - `id` string, uuid, required: Notification configuration ID
        - `eventType` string, required: Event type (e.g., workflow_finished, error)
        - `eventConfiguration` object, required: Event-specific config
        - `enabled` boolean, required: Whether this notification is enabled
        - `channels` object[], required: Linked notification channels
          - `channelId` string, uuid, required
          - `channelName` string, required
          - `channelType` string, required
      - `frequency` object, nullable, required: Frequency configuration for this version
        - `interval` 'ONLY_ONCE' | 'EVERY_10_MINUTES' | 'EVERY_20_MINUTES' | 'HALF_HOURLY' | 'HOURLY' | 'TWO_HOURLY' | 'THREE_HOURLY' | 'FOUR_HOURLY' | 'SIX_HOURLY' | 'TWELVE_HOURLY' | 'EIGHTEEN_HOURLY' | 'DAILY' | 'TWO_DAY' | 'THREE_DAY' | 'WEEKLY' | 'BIWEEKLY' | 'TRIWEEKLY' | 'FOUR_WEEKS' | 'MONTHLY' | 'CUSTOM': Update interval enum (HOURLY/DAILY/CUSTOM/...). When CUSTOM, schedules must be provided.
        - `schedules` object[]: Cron/repeat schedule specs. Required when interval=CUSTOM.
          - `type` 'repeat' | 'cron', required: Schedule type
          - `interval` string: Repeat token (e.g., '1h', '1d') when type=repeat
          - `expressions` string[]: Cron expressions when type=cron
          - `timezone` string: IANA timezone for cron expressions (e.g. 'America/New_York'). Defaults to UTC.
        - `weekdaysOnly` boolean: Skip runs that fall on Saturday or Sunday. Applies only to repeat intervals; for cron, set the weekdays in the expression.
      - `recordLimit` integer, nullable: Immutable output record limit; null when managed unlimited or unmanaged
      - `recordLimitManaged` boolean: Whether this version owns the workflow output record limit
      - `createdAt` string, required: Creation timestamp
      - `schemaName` string, nullable: Name of the linked schema
      - `schemaEntity` string, nullable: Entity name from the linked schema

## Other responses

- `401`: 401
- `404`: 404
- `500`: 500

---

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