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

# Preview Message

> Calculate message segments, character count, encoding type, units, and estimated cost before sending.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/messaging/sms/preview
openapi: 3.1.0
info:
  title: Zeckta Messaging API
  description: |
    Zeckta Messaging API provides SMS messaging,
    OTP verification, Sender Name management,
    delivery tracking, campaign messaging,
    and webhook integrations.
  contact:
    name: Zeckta
    url: https://zeckta.com
    email: support@zeckta.com
  license:
    name: Commercial
  version: 1.0.0
servers:
  - url: https://api.zeckta.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: SMS Messaging
    description: RESTful endpoints for single and bulk SMS
  - name: Sender Names
    description: SMS sender name management
  - name: Workspace
    description: Manage and inspect workspace / account details
  - name: OTP Service
    description: RESTful endpoints for 2-Factor Authentication
paths:
  /v1/messaging/sms/preview:
    get:
      tags:
        - SMS Messaging
      summary: Preview Message
      description: >-
        Calculate message segments, character count, encoding type, units, and
        estimated cost before sending.
      operationId: previewMessage
      parameters:
        - name: src
          in: query
          required: true
          schema:
            type: string
        - name: dest
          in: query
          required: true
          schema:
            type: string
        - name: message
          in: query
          required: true
          schema:
            type: string
        - name: priority
          in: query
          required: false
          schema:
            type: string
            default: normal
        - name: type
          in: query
          required: false
          schema:
            type: string
            default: plain
      responses:
        '200':
          description: Message preview calculated successfully
          content:
            '*/*':
              schema:
                $ref: >-
                  #/components/schemas/ZecktaApiResponseMessagePreviewResponseDTO
        '400':
          description: Invalid request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '402':
          description: Payment Required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '404':
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '409':
          description: Conflict
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ZecktaApiResponseObject'
components:
  schemas:
    ZecktaApiResponseMessagePreviewResponseDTO:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/MessagePreviewResponseDTO'
        requestId:
          type: string
    ZecktaApiResponseObject:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
        requestId:
          type: string
    MessagePreviewResponseDTO:
      type: object
      properties:
        src:
          type: string
        dest:
          type: string
        message:
          type: string
        encoding:
          type: string
        gsm7:
          type: boolean
        segments:
          type: integer
          format: int32
        messageLength:
          type: integer
          format: int32
        units:
          type: integer
          format: int64
        cost:
          type: integer
          format: int64
        priority:
          type: string
        type:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      description: 'Provide your Zeckta API Key using: Bearer YOUR_API_KEY'
      scheme: bearer
      bearerFormat: API Key

````