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

# Create Message Template

> Create a new message template with variable placeholders.

**Variables:**
- Use double curly braces: `{{variable_name}}`
- Variables are case-sensitive
- No spaces in variable names
- Example: `Hello {{name}}, your code is {{code}}`

**Benefits:**
- Consistent messaging across your application
- Easy personalization
- Reusability
- Version control



## OpenAPI

````yaml POST /templates
openapi: 3.0.0
info:
  title: Xerobi Certification & Badge API
  version: '2026-01-01'
  description: >-
    A comprehensive API for issuing, managing, and verifying digital
    certificates and badges. Perfect for educational institutions, certification
    bodies, and organizations requiring verifiable credential management.
    Supports certificate templates, digital badges, credential lifecycle
    management, public verification, webhooks, and comprehensive audit logging.
  contact:
    name: Xerobi Support
    email: support@xerobi.com
  license:
    name: Proprietary
servers:
  - url: https://api.hixbe.com/certify
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Templates
    description: >-
      Certificate template management - create and manage reusable certificate
      designs
  - name: Credentials
    description: >-
      Issued credential management - view and track digital certificates and
      badges
  - name: Badges
    description: Digital badge definitions - create and manage badge metadata and criteria
  - name: Verification
    description: Public credential verification - validate issued certificates and badges
  - name: Issuance
    description: >-
      Credential issuance - create and distribute digital certificates and
      badges
  - name: Webhooks
    description: Event notifications - configure webhooks for credential lifecycle events
  - name: Audit Logs
    description: >-
      Activity tracking - comprehensive audit trail for all credential
      operations
  - name: Programs
    description: Certification programs - organize credentials into structured programs
  - name: Revocation
    description: Credential revocation - invalidate certificates and badges when necessary
paths:
  /templates:
    post:
      tags:
        - Templates
      summary: Create certificate template
      description: >-
        Create a new certificate template with custom background image and field
        definitions. Templates are reusable designs for issuing certificates.
      operationId: createTemplate
      parameters:
        - $ref: '#/components/parameters/Xerobi-Version'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplateRequest'
            example:
              name: Professional Certification
              background_url: https://example.com/certificates/professional-cert-bg.png
              fields:
                - recipient_name
                - course_title
                - completion_date
                - instructor_name
      responses:
        '201':
          description: Certificate template created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateResponse'
              example:
                id: tmpl_1234567890abcdef
                name: Professional Certification
                created_at: '2025-12-03T10:00:00Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    Xerobi-Version:
      name: Xerobi-Version
      in: header
      required: true
      schema:
        type: string
        example: '2026-01-01'
      description: API version in YYYY-MM-DD format
  schemas:
    CreateTemplateRequest:
      type: object
      description: Request payload for creating a new certificate template
      required:
        - name
        - background_url
      properties:
        name:
          type: string
          description: Display name for the certificate template
          example: Professional Certification
        background_url:
          type: string
          format: uri
          description: URL to the background image for the certificate
          example: https://example.com/certificates/professional-cert-bg.png
        fields:
          type: array
          description: Array of field names that can be populated when issuing certificates
          items:
            type: string
            example: recipient_name
          example:
            - recipient_name
            - course_title
            - completion_date
            - instructor_name
    TemplateResponse:
      type: object
      description: Response containing certificate template information
      properties:
        id:
          type: string
          description: Unique identifier for the template
          example: tmpl_1234567890abcdef
        name:
          type: string
          description: Display name of the template
          example: Professional Certification
        created_at:
          type: string
          format: date-time
          description: Timestamp when the template was created
          example: '2025-12-01T10:00:00Z'
    Error:
      type: object
      description: Standard error response format
      properties:
        error:
          type: string
          description: Error type identifier
          example: invalid_request
        message:
          type: string
          description: Human-readable error message
          example: The credential ID provided is invalid
        code:
          type: string
          description: Optional error code for programmatic handling
          example: INVALID_CREDENTIAL_ID
      required:
        - error
        - message
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

## Related topics

- [Create Template](https://docs.xerobi.com/certify/endpoint/create-template.md)
- [List Message Templates](https://docs.xerobi.com/sms-api/endpoint/list-templates.md)
- [Xerobi SMS Gateway API Introduction](https://docs.xerobi.com/sms-api/introduction.md)
- [SMS API FAQ](https://docs.xerobi.com/faq-guides/sms-api-faq.md)
- [Certification API FAQ](https://docs.xerobi.com/faq-guides/certification-api-faq.md)


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