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

# Match input to templates

> Find best matching template slides/layouts for the given input data.



## OpenAPI

````yaml /openapi/powerpoint-api.json post /api/v1/templates/match
openapi: 3.1.0
info:
  title: SlideKit
  description: >-
    A comprehensive API for PowerPoint template management and presentation
    generation
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/templates/match:
    post:
      tags:
        - templates
      summary: Match input to templates
      description: Find best matching template slides/layouts for the given input data.
      operationId: match_input_to_templates_api_v1_templates_match_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MatchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    MatchRequest:
      properties:
        org_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Name
          description: >-
            Organization name to scope the search. If provided, must match the
            API key's organization. If omitted, the API key's organization is
            used.
        slide_data:
          additionalProperties: true
          type: object
          title: Slide Data
          description: Slide data input (same format as SlideDataInput for generation)
        match_against:
          type: string
          title: Match Against
          description: Match against 'slides' or 'layouts'
          default: slides
        top_k:
          type: integer
          maximum: 20
          minimum: 1
          title: Top K
          description: Number of top matches to return
          default: 5
      type: object
      required:
        - slide_data
      title: MatchRequest
      description: Request schema for template matching.
    MatchResponse:
      properties:
        input_signature:
          additionalProperties: true
          type: object
          title: Input Signature
          description: Parsed input signature
        matches:
          items:
            $ref: '#/components/schemas/MatchResultResponse'
          type: array
          title: Matches
          description: Ranked match results
        best_match:
          anyOf:
            - $ref: '#/components/schemas/MatchResultResponse'
            - type: 'null'
          description: Top match
        total_templates_searched:
          type: integer
          title: Total Templates Searched
          description: Number of templates searched
        total_slides_searched:
          type: integer
          title: Total Slides Searched
          description: Number of slides/layouts searched
      type: object
      required:
        - input_signature
        - matches
        - total_templates_searched
        - total_slides_searched
      title: MatchResponse
      description: Response schema for template matching.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MatchResultResponse:
      properties:
        template_id:
          type: string
          title: Template Id
          description: Template ID this slide belongs to
        slide_id:
          type: string
          title: Slide Id
          description: Slide or layout ID
        slide_index:
          type: integer
          title: Slide Index
          description: 0-based index within template
        layout_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Layout Name
          description: Layout name if available
        score:
          type: number
          title: Score
          description: Match score (higher is better)
        is_exact_match:
          type: boolean
          title: Is Exact Match
          description: True if input exactly fits template
        matched_counts:
          $ref: '#/components/schemas/MatchedCountsResponse'
          description: What content was matched
        overflow_counts:
          anyOf:
            - $ref: '#/components/schemas/MatchedCountsResponse'
            - type: 'null'
          description: Content that won't fit (data loss)
        unused_counts:
          anyOf:
            - $ref: '#/components/schemas/MatchedCountsResponse'
            - type: 'null'
          description: Template placeholders that won't be filled
      type: object
      required:
        - template_id
        - slide_id
        - slide_index
        - score
        - is_exact_match
        - matched_counts
      title: MatchResultResponse
      description: Single match result.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MatchedCountsResponse:
      properties:
        title:
          anyOf:
            - type: integer
            - type: 'null'
          title: Title
        subtitle:
          anyOf:
            - type: integer
            - type: 'null'
          title: Subtitle
        body:
          anyOf:
            - type: integer
            - type: 'null'
          title: Body
        footer:
          anyOf:
            - type: integer
            - type: 'null'
          title: Footer
        table:
          anyOf:
            - type: integer
            - type: 'null'
          title: Table
        chart:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chart
        textbox:
          anyOf:
            - type: integer
            - type: 'null'
          title: Textbox
        object:
          anyOf:
            - type: integer
            - type: 'null'
          title: Object
        custom_field:
          anyOf:
            - type: integer
            - type: 'null'
          title: Custom Field
      type: object
      title: MatchedCountsResponse
      description: Counts of matched content types.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Production API key. Development/test deployments may also allow
        X-Org-Name.

````