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

# Get a template

> Declared context fields, question and options of a template — what a connector needs to build dynamic fields before the decision exists.



## OpenAPI

````yaml /openapi.yaml get /templates/{key}
openapi: 3.1.0
info:
  title: Branch Pilot API
  version: '1.0'
  summary: The AI decision layer for workflows.
  description: >
    One endpoint per decision. Send the input your decision expects, get a typed
    answer with

    calibrated probabilities, a confidence and the engine that produced it.


    Personal data in declared PII fields (and detected in free text) is
    pseudonymized before

    any model call; only the pseudonymized input is logged.
  contact:
    email: hello@branchpilot.ai
  termsOfService: https://branchpilot.ai/terms
servers:
  - url: https://api.branchpilot.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Decide
  - name: Runs
  - name: Decisions
  - name: Templates
paths:
  /templates/{key}:
    get:
      tags:
        - Templates
      summary: Get a template
      description: >-
        Declared context fields, question and options of a template — what a
        connector needs to build dynamic fields before the decision exists.
      operationId: getTemplate
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
            example: lead-routing
        - $ref: '#/components/parameters/locale'
      responses:
        '200':
          description: The template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    locale:
      name: locale
      in: query
      required: false
      description: Locale of the template texts.
      schema:
        type: string
        enum:
          - en
          - fr
        default: en
  schemas:
    TemplateDetail:
      allOf:
        - $ref: '#/components/schemas/TemplateSummary'
        - type: object
          properties:
            context:
              type:
                - object
                - 'null'
              properties:
                description:
                  type: string
                fields:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      type:
                        type: string
                        enum:
                          - string
                          - number
                          - boolean
                          - object
                          - array
                      required:
                        type: boolean
                      pii:
                        type: boolean
                      description:
                        type: string
                example: {}
            instructions:
              type: string
            test_cases:
              type: integer
              description: Number of test cases cloned with the template.
    TemplateSummary:
      type: object
      properties:
        key:
          type: string
        type:
          type: string
          enum:
            - route
            - score
            - classify
        name:
          type: string
        description:
          type: string
        use_case:
          type: string
        featured:
          type: boolean
        options:
          type: array
          items:
            type: string
        levels:
          type: array
          items:
            type: string
        labels:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
  responses:
    Unauthorized:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Unknown resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key created in Settings → API keys (`bp_live_…` or `bp_test_…`).

````