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

# templates.create(pathOrDocument): the next version of the document's name



## OpenAPI

````yaml /api-reference/openapi.json post /templates
openapi: 3.1.0
info:
  title: paddock API
  version: 1.0.0
  description: >-
    The paddock API. Send an API key, or a session token on its own session, as
    a bearer token.
servers:
  - url: https://api.paddock.build/v1
security:
  - bearer: []
paths:
  /templates:
    post:
      summary: >-
        templates.create(pathOrDocument): the next version of the document's
        name
      operationId: createTemplate
      parameters:
        - name: dryRun
          in: query
          required: false
          description: >-
            Check the document and answer the version a create would return,
            storing nothing
          schema:
            type: boolean
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateDocument'
          application/yaml:
            schema:
              type: string
      responses:
        '200':
          description: >-
            The document equals the name's latest version, or the answer of a
            dry run
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '201':
          description: Created
          headers:
            Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    TemplateDocument:
      description: A template as one document, in its JSON spelling.
      type: object
      additionalProperties: false
      required:
        - apiVersion
        - kind
        - metadata
        - spec
      properties:
        apiVersion:
          type: string
          enum:
            - paddock.build/v1
        kind:
          type: string
          enum:
            - Template
        metadata:
          $ref: '#/components/schemas/TemplateMetadata'
        spec:
          $ref: '#/components/schemas/TemplateSpec'
    Template:
      type: object
      required:
        - name
        - version
        - harness
        - model
        - labels
        - digest
        - createdAt
      properties:
        name:
          type: string
          pattern: ^[a-z0-9-]{1,64}$
        version:
          type: integer
          minimum: 1
        harness:
          $ref: '#/components/schemas/Harness'
        model:
          type: string
        labels:
          $ref: '#/components/schemas/Metadata'
        digest:
          type: string
        createdAt:
          $ref: '#/components/schemas/Timestamp'
    TemplateMetadata:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          pattern: ^[a-z0-9-]{1,64}$
        labels:
          $ref: '#/components/schemas/Metadata'
    TemplateSpec:
      type: object
      additionalProperties: false
      required:
        - harness
        - model
      properties:
        harness:
          $ref: '#/components/schemas/Harness'
        model:
          type: string
        smallModel:
          description: 'claude-code only: its small model.'
          type: string
        systemPrompt:
          type: string
        env:
          type: array
          items:
            $ref: '#/components/schemas/EnvEntry'
        permissions:
          $ref: '#/components/schemas/PermissionsSpec'
        mcp:
          type: array
          items:
            $ref: '#/components/schemas/McpEntry'
        marketplaces:
          type: array
          items:
            $ref: '#/components/schemas/MarketplaceEntry'
        plugins:
          type: array
          items:
            $ref: '#/components/schemas/PluginEntry'
    Harness:
      type: string
      enum:
        - claude-code
        - codex
        - pi
    Metadata:
      description: The customer's own string keys and values; never case-converted.
      type: object
      additionalProperties:
        type: string
    Timestamp:
      description: RFC 3339 in UTC with milliseconds.
      type: string
      format: date-time
      pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}Z$
      x-go-type: wire.Timestamp
      x-go-type-import:
        path: github.com/wenfengwang/paddock/internal/wire
    ErrorBody:
      description: The body of every non-2xx response.
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    EnvEntry:
      type: object
      additionalProperties: false
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
    PermissionsSpec:
      type: object
      additionalProperties: false
      required:
        - allow
        - deny
      properties:
        allow:
          type: array
          items:
            type: string
        deny:
          type: array
          items:
            type: string
    McpEntry:
      description: 'An MCP server: a remote one by URL, or one that runs in the sandbox.'
      oneOf:
        - $ref: '#/components/schemas/McpRemoteEntry'
        - $ref: '#/components/schemas/McpLocalEntry'
    MarketplaceEntry:
      type: object
      additionalProperties: false
      required:
        - name
        - source
      properties:
        name:
          type: string
        source:
          description: 'host/owner/repo: a public Git repository holding a marketplace file.'
          type: string
        revision:
          description: 'Read-only: raised by refresh.'
          type: integer
          minimum: 0
    PluginEntry:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          description: plugin@marketplace
          type: string
        enabled:
          type: boolean
    ErrorObject:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
        details:
          type: object
    McpRemoteEntry:
      type: object
      additionalProperties: false
      required:
        - name
        - url
      properties:
        name:
          type: string
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
    McpLocalEntry:
      type: object
      additionalProperties: false
      required:
        - name
        - command
      properties:
        name:
          type: string
        command:
          type: string
        args:
          type: array
          items:
            type: string
        env:
          type: object
          additionalProperties:
            type: string
    ErrorCode:
      type: string
      enum:
        - invalid_request
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - payload_too_large
        - unsupported
        - unavailable
        - internal
  headers:
    RequestId:
      description: The request's ID, for support and logs
      schema:
        type: string
  responses:
    Error:
      description: Every non-2xx response
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key, or a session token on its own session

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.