SMSAPI Profile and Account API

Retrieve account profile details and current credit balance (points) via GET /profile for monitoring available funds before sending.

OpenAPI Specification

smsapi-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: SMSAPI REST API
  description: >-
    Representative OpenAPI description of the SMSAPI messaging platform, a
    European bulk-messaging provider (part of LINK Mobility). Covers SMS, MMS,
    voice (VMS), contacts, sender names, two-factor authentication, subusers,
    account profile, HLR lookup, blacklist, and short URLs. Requests are
    authenticated with an OAuth 2.0 bearer token issued from the SMSAPI
    customer panel.
  termsOfService: https://www.smsapi.com/en/terms
  contact:
    name: SMSAPI Support
    url: https://www.smsapi.com/docs/
    email: bok@smsapi.pl
  version: '1.0'
servers:
  - url: https://api.smsapi.com
    description: Global endpoint (com)
  - url: https://api.smsapi.eu
    description: European endpoint (eu)
security:
  - bearerAuth: []
tags:
  - name: SMS
  - name: MMS
  - name: VMS
  - name: Contacts
  - name: Sender Names
  - name: 2FA
  - name: Subusers
  - name: Profile
  - name: HLR
  - name: Blacklist
  - name: Short URLs
paths:
  /sms.do:
    post:
      operationId: sendSms
      tags:
        - SMS
      summary: Send an SMS message.
      description: >-
        Send single, bulk, scheduled, or templated text messages. Provide
        format=json to receive a JSON response. Supports personalization,
        flash messages, opt-out links, and cut.li short URLs.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendSmsRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
  /mms.do:
    post:
      operationId: sendMms
      tags:
        - MMS
      summary: Send an MMS message.
      description: >-
        Send a multimedia message with SMIL/image content to one or many
        recipients, with optional scheduling.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendMmsRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
  /vms.do:
    post:
      operationId: sendVms
      tags:
        - VMS
      summary: Send a voice message (VMS).
      description: >-
        Deliver a voice message generated from text-to-speech (tts) or from an
        uploaded audio file, with optional scheduling.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SendVmsRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
  /profile:
    get:
      operationId: getProfile
      tags:
        - Profile
      summary: Get account profile and balance.
      description: Returns account profile details and the current points (credit) balance.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
  /contacts:
    get:
      operationId: listContacts
      tags:
        - Contacts
      summary: List contacts.
      parameters:
        - name: offset
          in: query
          schema:
            type: integer
        - name: limit
          in: query
          schema:
            type: integer
        - name: phone_number
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactCollection'
    post:
      operationId: createContact
      tags:
        - Contacts
      summary: Create a contact.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
  /contacts/{contactId}:
    get:
      operationId: getContact
      tags:
        - Contacts
      summary: Get a contact.
      parameters:
        - $ref: '#/components/parameters/ContactId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
    put:
      operationId: updateContact
      tags:
        - Contacts
      summary: Update a contact.
      parameters:
        - $ref: '#/components/parameters/ContactId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
    delete:
      operationId: deleteContact
      tags:
        - Contacts
      summary: Delete a contact.
      parameters:
        - $ref: '#/components/parameters/ContactId'
      responses:
        '204':
          description: No Content
  /contacts/groups:
    get:
      operationId: listContactGroups
      tags:
        - Contacts
      summary: List contact groups.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupCollection'
    post:
      operationId: createContactGroup
      tags:
        - Contacts
      summary: Create a contact group.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
  /contacts/{contactId}/groups/{groupId}:
    put:
      operationId: assignContactToGroup
      tags:
        - Contacts
      summary: Assign a contact to a group.
      parameters:
        - $ref: '#/components/parameters/ContactId'
        - $ref: '#/components/parameters/GroupId'
      responses:
        '200':
          description: OK
    delete:
      operationId: removeContactFromGroup
      tags:
        - Contacts
      summary: Remove a contact from a group.
      parameters:
        - $ref: '#/components/parameters/ContactId'
        - $ref: '#/components/parameters/GroupId'
      responses:
        '204':
          description: No Content
  /sendernames:
    get:
      operationId: listSenderNames
      tags:
        - Sender Names
      summary: List sender names.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SenderNameCollection'
    post:
      operationId: createSenderName
      tags:
        - Sender Names
      summary: Register a new sender name.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SenderNameInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SenderName'
  /sendernames/{sender}:
    get:
      operationId: getSenderName
      tags:
        - Sender Names
      summary: Get a sender name.
      parameters:
        - $ref: '#/components/parameters/Sender'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SenderName'
    delete:
      operationId: deleteSenderName
      tags:
        - Sender Names
      summary: Delete a sender name.
      parameters:
        - $ref: '#/components/parameters/Sender'
      responses:
        '204':
          description: No Content
  /sendernames/{sender}/default:
    put:
      operationId: setDefaultSenderName
      tags:
        - Sender Names
      summary: Set a sender name as default.
      parameters:
        - $ref: '#/components/parameters/Sender'
      responses:
        '200':
          description: OK
  /authenticator/send_code:
    post:
      operationId: sendAuthCode
      tags:
        - 2FA
      summary: Send a one-time 2FA code.
      description: Generate and deliver a one-time passcode over SMS or voice.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendCodeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendCodeResponse'
  /authenticator/check_code:
    post:
      operationId: checkAuthCode
      tags:
        - 2FA
      summary: Validate a one-time 2FA code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckCodeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckCodeResponse'
  /subusers:
    get:
      operationId: listSubusers
      tags:
        - Subusers
      summary: List subusers.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubuserCollection'
    post:
      operationId: createSubuser
      tags:
        - Subusers
      summary: Create a subuser.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubuserInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subuser'
  /subusers/{subuserId}:
    get:
      operationId: getSubuser
      tags:
        - Subusers
      summary: Get a subuser.
      parameters:
        - $ref: '#/components/parameters/SubuserId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subuser'
    put:
      operationId: updateSubuser
      tags:
        - Subusers
      summary: Update a subuser.
      parameters:
        - $ref: '#/components/parameters/SubuserId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubuserInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subuser'
    delete:
      operationId: deleteSubuser
      tags:
        - Subusers
      summary: Delete a subuser.
      parameters:
        - $ref: '#/components/parameters/SubuserId'
      responses:
        '204':
          description: No Content
  /hlr.do:
    post:
      operationId: hlrLookup
      tags:
        - HLR
      summary: Perform an HLR lookup.
      description: >-
        Validate a phone number and resolve carrier, portability, and
        reachability information.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                number:
                  type: string
                idx:
                  type: string
                format:
                  type: string
                  default: json
              required:
                - number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HlrResult'
  /blacklist/phone_numbers:
    get:
      operationId: listBlacklist
      tags:
        - Blacklist
      summary: List blacklisted phone numbers.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlacklistCollection'
    post:
      operationId: addBlacklistNumber
      tags:
        - Blacklist
      summary: Add a phone number to the blacklist.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlacklistInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlacklistEntry'
  /blacklist/phone_numbers/{phoneNumber}:
    delete:
      operationId: removeBlacklistNumber
      tags:
        - Blacklist
      summary: Remove a phone number from the blacklist.
      parameters:
        - name: phoneNumber
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
  /short_urls/links:
    get:
      operationId: listShortUrls
      tags:
        - Short URLs
      summary: List cut.li short links.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortUrlCollection'
    post:
      operationId: createShortUrl
      tags:
        - Short URLs
      summary: Create a cut.li short link.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShortUrlInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortUrl'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 bearer token generated in the SMSAPI customer panel (API Tokens).
  parameters:
    ContactId:
      name: contactId
      in: path
      required: true
      schema:
        type: string
    GroupId:
      name: groupId
      in: path
      required: true
      schema:
        type: string
    Sender:
      name: sender
      in: path
      required: true
      schema:
        type: string
    SubuserId:
      name: subuserId
      in: path
      required: true
      schema:
        type: string
  schemas:
    SendSmsRequest:
      type: object
      properties:
        to:
          type: string
          description: Comma-separated recipient MSISDN(s).
        message:
          type: string
        from:
          type: string
          description: Registered sender name.
        date:
          type: string
          description: Unix timestamp or ISO date for scheduled delivery.
        encoding:
          type: string
        flash:
          type: integer
        template:
          type: string
        fast:
          type: integer
        format:
          type: string
          default: json
      required:
        - to
        - message
    SendMmsRequest:
      type: object
      properties:
        to:
          type: string
        subject:
          type: string
        smil:
          type: string
          description: SMIL document describing the multimedia content.
        date:
          type: string
        format:
          type: string
          default: json
      required:
        - to
        - smil
    SendVmsRequest:
      type: object
      properties:
        to:
          type: string
        tts:
          type: string
          description: Text to be read out via text-to-speech.
        file:
          type: string
          description: URL or reference to an uploaded audio file.
        tts_lector:
          type: string
        date:
          type: string
        format:
          type: string
          default: json
      required:
        - to
    SendMessageResponse:
      type: object
      properties:
        count:
          type: integer
        list:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              points:
                type: number
              number:
                type: string
              status:
                type: string
    Profile:
      type: object
      properties:
        username:
          type: string
        points:
          type: object
          properties:
            points:
              type: number
        payment_type:
          type: integer
    Contact:
      type: object
      properties:
        id:
          type: string
        phone_number:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        source:
          type: string
        date_created:
          type: string
    ContactInput:
      type: object
      properties:
        phone_number:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
      required:
        - phone_number
    ContactCollection:
      type: object
      properties:
        size:
          type: integer
        collection:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
    Group:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        contacts_count:
          type: integer
    GroupInput:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
      required:
        - name
    GroupCollection:
      type: object
      properties:
        size:
          type: integer
        collection:
          type: array
          items:
            $ref: '#/components/schemas/Group'
    SenderName:
      type: object
      properties:
        sender:
          type: string
        status:
          type: string
          description: Sender name status (e.g. ACTIVE, INACTIVE).
        is_default:
          type: boolean
    SenderNameInput:
      type: object
      properties:
        sender:
          type: string
      required:
        - sender
    SenderNameCollection:
      type: array
      items:
        $ref: '#/components/schemas/SenderName'
    SendCodeRequest:
      type: object
      properties:
        recipient:
          type: string
        channel:
          type: string
          enum:
            - sms
            - call
        from:
          type: string
        message_template:
          type: string
        expiry:
          type: integer
      required:
        - recipient
    SendCodeResponse:
      type: object
      properties:
        id:
          type: string
        recipient:
          type: string
        channel:
          type: string
        expires_at:
          type: string
    CheckCodeRequest:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
      required:
        - id
        - code
    CheckCodeResponse:
      type: object
      properties:
        id:
          type: string
        valid:
          type: boolean
    Subuser:
      type: object
      properties:
        id:
          type: string
        username:
          type: string
        active:
          type: boolean
        points:
          type: object
          properties:
            from_account:
              type: boolean
            per_month:
              type: number
    SubuserInput:
      type: object
      properties:
        username:
          type: string
        password:
          type: string
        active:
          type: boolean
        api_access:
          type: boolean
      required:
        - username
        - password
    SubuserCollection:
      type: object
      properties:
        size:
          type: integer
        collection:
          type: array
          items:
            $ref: '#/components/schemas/Subuser'
    HlrResult:
      type: object
      properties:
        number:
          type: string
        status:
          type: string
        ported:
          type: boolean
        network:
          type: string
        country:
          type: string
    BlacklistEntry:
      type: object
      properties:
        phone_number:
          type: string
        created_at:
          type: string
    BlacklistInput:
      type: object
      properties:
        phone_number:
          type: string
      required:
        - phone_number
    BlacklistCollection:
      type: object
      properties:
        size:
          type: integer
        collection:
          type: array
          items:
            $ref: '#/components/schemas/BlacklistEntry'
    ShortUrl:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
        short_url:
          type: string
        clicks:
          type: integer
    ShortUrlInput:
      type: object
      properties:
        name:
          type: string
        url:
          type: string
      required:
        - url
    ShortUrlCollection:
      type: object
      properties:
        size:
          type: integer
        collection:
          type: array
          items:
            $ref: '#/components/schemas/ShortUrl'