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

# Create Template

> Create a new template for your client.

Refer to the [Policy Validation with Templates](/guides/validate/policy-validation#validation-templates) guide for more details.

⚠️ This endpoint will generate template only for provided `clientId`, and if provided, for `destinationId`. If you are a platform client
and want to create a template for all of your clients, refer to [create platform templates API](/api-reference/platform/create-templates) endpoint



## OpenAPI

````yaml POST /validation/templates
openapi: 3.0.0
info:
  title: Axle API
  contact: {}
  version: '0.1'
servers:
  - description: Sandbox
    url: https://sandbox.axle.insure
  - description: Production
    url: https://api.axle.insure
    variables: {}
security:
  - ApiKeyAuth: []
paths:
  /validation/templates:
    post:
      tags:
        - Templates
      summary: Create Template
      description: >-
        Create a new template for your client.


        Refer to the [Policy Validation with
        Templates](/guides/validate/policy-validation#validation-templates)
        guide for more details.


        ⚠️ This endpoint will generate template only for provided `clientId`,
        and if provided, for `destinationId`. If you are a platform client

        and want to create a template for all of your clients, refer to [create
        platform templates API](/api-reference/platform/create-templates)
        endpoint
      operationId: CreateTemplate
      parameters:
        - $ref: '#/components/parameters/x-client-id'
        - $ref: '#/components/parameters/x-destination-client-id'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              description: ''
              type: object
              properties:
                displayName:
                  type: string
                  description: User friendly name of the template.
                rules:
                  type: array
                  description: A list of Rules to perform on the policy object.
                  items:
                    oneOf:
                      - $ref: '#/components/schemas/RuleTemplateWithNoInput'
                      - $ref: '#/components/schemas/RuleTemplateWithInput'
              required:
                - displayName
                - rules
            example:
              displayName: Example Template
              rules:
                - rule: policy-active
                - rule: collision-coverage-meets-requirements
                  input:
                    deductible:
                      source: maxDeductible
                      default: 500
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/Success'
                  data:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: >-
                          The ID of the newly created template. You'll use this
                          ID to make requests to [validate
                          policy](/api-reference/validation/templates/validate-policy-template)
                          using this template ID.
                required:
                  - success
                  - data
        '400':
          $ref: '#/components/responses/InputValidation'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      deprecated: false
components:
  parameters:
    x-client-id:
      name: x-client-id
      in: header
      required: true
      schema:
        type: string
      description: Your client ID. This will be shared with you during onboarding.
    x-destination-client-id:
      name: x-destination-client-id
      in: header
      required: false
      schema:
        type: string
      description: >-
        The client ID of the destination client. This is optional and only used
        by platform clients. See the [Axle for
        Platforms](/guides/platform-integration) guide for more information.
  schemas:
    RuleTemplateWithNoInput:
      title: Rule With No Input
      type: object
      properties:
        rule:
          type: string
          enum:
            - policy-active
            - rental-covered-for-collision
      required:
        - rule
    RuleTemplateWithInput:
      title: Rule With Input
      type: object
      properties:
        rule:
          type: string
          enum:
            - collision-coverage-meets-requirements
            - comprehensive-coverage-meets-requirements
            - bodily-injury-coverage-meets-requirements
            - property-damage-coverage-meets-requirements
            - uninsured-underinsured-bi-coverage-meets-requirements
            - uninsured-underinsured-pd-coverage-meets-requirements
            - expiration-date-comparison
            - insureds-match
            - properties-match
            - address-match
            - required-policy-information-is-present
            - vehicle-use-meets-requirements
            - third-party-matches
        input:
          type: object
          description: >-
            Input configuration to evaluate the rule. See [Supported
            Rules](/guides/policy-validation#supported-rules) for details on
            which Rules require additional input.
          properties:
            inputKey:
              type: object
              description: >-
                The inputKey is the key corresponding to the Rule input, e.g.,
                "vin" or "deductible".
              properties:
                source:
                  type: string
                  description: >-
                    The key used to look up this input's value at evaluation
                    time. Axle resolves the value by checking (in order of
                    priority):


                    1. The `metadata` object passed in the [Validate Policy with
                    Template](/api-reference/validation/templates/validate-policy-template)
                    request body.

                    2. The `metadata` object via [Start
                    Ignition](/api-reference/ignition/start-ignition).

                    3. The `default` value defined on this input (if set).


                    For example, if `source` is `"maxDeductible"`, Axle will
                    look for a key named `maxDeductible` in the metadata objects
                    above.
                default:
                  oneOf:
                    - type: string
                    - type: number
                    - type: boolean
                    - type: array
                  description: >-
                    Fallback value used when the `source` key is not found in
                    either the request body metadata or the Ignition session
                    metadata. If no `default` is provided and the key is not
                    found, the rule will be evaluated without this input.
              required:
                - source
      required:
        - rule
        - input
    Success:
      title: Success
      type: boolean
      description: Indicates whether the operation was performed successfully.
      x-internal: false
      example: true
  responses:
    InputValidation:
      description: The request body is invalid. See the error message for details.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: >-
                  Input validation failed due to one or more missing or invalid
                  parameters. Review the request and try again.
    TooManyRequests:
      description: >-
        Rate limit exceeded. This is only to protect Axle systems against errant
        or abnormal request volume. The limit is sufficiently high for all
        normal usage.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Too Many Requests
            required:
              - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your secret API key. This will be shared with you during onboarding and
        should be considered sensitive - it’s a password after all! Your secret
        will be matched with your client ID to authenticate your requests.

````