openapi: 3.0.3
info:
  title: ZealcubeSMS
  description: ''
  version: 1.0.0
servers:
  - url: 'https://smsapi.zealcube.com'
paths:
  /login:
    post:
      summary: 'API Auth Token'
      description: "Generate API Authentication token\n\nTo generate the API Auth token, make a POST request to /login with your email and Password.\n\nThis Token will be used in the authorization header of each API request you need to submit."
      parameters:
        - in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        - in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses: { }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The API user''s Email Address'
                  example: username@example.com
                password:
                  type: string
                  description: 'The API user''s password.'
                  example: P@31dW0Red
              required:
                - email
                - password
      security: [ ]
  /balance:
    get:
      summary: 'SMS units balance'
      description: 'Generate API Authentication token'
      parameters:
        - in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_TOKEN}'
          schema:
            type: string
        - in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        - in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Endpoints
  /sendsms:
    post:
      summary: 'Send SMS'
      description: 'Send messages to your clients.'
      parameters:
        - in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_TOKEN}'
          schema:
            type: string
        - in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        - in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses: { }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  description: 'The senderID/shortcode you''ll use to send the message'
                  example: ZEALCUBE
                phone:
                  type: string
                  description: 'The phone number you want to send a message to.'
                  example: '254712345678'
                message:
                  type: string
                  description: 'The text content you want to send.'
                  example: 'Welcome to Zealcube'
                message_id:
                  type: string
                  description: 'optional A unique reference to enable track the message.'
                  example: 35345k52e9-1933ba-ksjk1
                webhook_url:
                  type: string
                  description: 'optional The URL where the SMS delivery reported will be POSTED to.'
                  example: 'https:/zealcube.com/sms-webhook'
              required:
                - from
                - phone
                - message
  /batch-sms:
    post:
      summary: 'Batch SMS'
      description: 'Enables sending multiple messages (batch) via a single API request'
      parameters:
        - in: header
          name: Authorization
          description: ''
          example: 'Bearer {YOUR_AUTH_TOKEN}'
          schema:
            type: string
        - in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        - in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses: { }
      tags:
        - Endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  description: 'The senderID/shortcode you''ll use to send the message'
                  example: ZEALCUBE
                messages:
                  type: object
                  description: 'This is an object consisting of a key value pair of the message and the phone you are sending the message to.'
                  example:
                    - message: 'just another test message'
                      phone: '254712345678'
                    - message: 'test message'
                      phone: '254712345679'
                      message_id: custom_messageID
                  properties: [ ]
                webhook_url:
                  type: string
                  description: 'optional The URL where the SMS delivery reported will be POSTED to.'
                  example: 'https:/zealcube.com/sms-webhook'
              required:
                - from
                - messages
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: ''
security:
  - default: [ ]
