Messente Number Lookup API

Synchronous HLR lookup at /hlr/sync returns network, roaming, and portability information for phone numbers, plus PIN-based number verification (2FA) at /verify/start and /verify/pin for confirming a user controls a number.

OpenAPI Specification

messente-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Messente API
  version: 2.1.0
  description: >-
    Messente is a global CPaaS provider of messaging and user verification
    services based in Estonia. Send and receive SMS, Viber, and WhatsApp
    messages through a single Omnimessage endpoint with an automatic fallback
    chain, manage contacts and groups in the Phonebook, look up phone number
    (HLR) information, run PIN-based number verification / 2FA, retrieve
    delivery reports, and pull messaging statistics. This is a faithful,
    representative OpenAPI description of the public Messente REST API; consult
    the official documentation for the authoritative contract.
  contact:
    name: Messente Support
    url: https://messente.com/documentation
    email: messente@messente.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://api.messente.com/v1
  description: Messente production API
security:
- basicAuth: []
tags:
- name: Omnimessage
  description: Send SMS, Viber, WhatsApp, and Telegram messages with an automatic fallback chain.
- name: Bulk Messaging
  description: Send an Omnimessage to many recipients in a single request.
- name: Delivery Report
  description: Retrieve delivery status for a sent Omnimessage.
- name: Contacts
  description: Manage contacts in the Messente Phonebook.
- name: Groups
  description: Manage contact groups in the Messente Phonebook.
- name: Blacklist
  description: Manage the phone number blacklist.
- name: Number Lookup
  description: Fetch HLR / network information about phone numbers.
- name: Number Verification
  description: PIN-based phone number verification (2FA / one-time passwords).
- name: Statistics
  description: Request messaging statistics reports by country.
- name: Pricing
  description: Retrieve account pricelist and per-country prices.
- name: Account Balance
  description: Retrieve the current account balance.
paths:
  /omnimessage:
    post:
      tags:
      - Omnimessage
      summary: Sends an Omnimessage
      description: >-
        Sends an Omnimessage across one or more channels (SMS, Viber, WhatsApp,
        Telegram). Channels are attempted in the order supplied as a fallback
        chain until delivery succeeds.
      operationId: sendOmnimessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Omnimessage'
      responses:
        '202':
          description: Omnimessage accepted for sending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OmniMessageCreateSuccessResponse'
        '400':
          description: Invalid input
        '401':
          description: Unauthorized
  /omnimessage/{omnimessageId}:
    delete:
      tags:
      - Omnimessage
      summary: Cancels a scheduled Omnimessage
      operationId: cancelScheduledMessage
      parameters:
      - name: omnimessageId
        in: path
        required: true
        description: The identifier of the Omnimessage to cancel.
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Omnimessage cancelled
        '404':
          description: Omnimessage not found
  /omnimessage/{omnimessageId}/status:
    get:
      tags:
      - Delivery Report
      summary: Retrieves the delivery report for an Omnimessage
      operationId: retrieveDeliveryReport
      parameters:
      - name: omnimessageId
        in: path
        required: true
        description: The identifier of the Omnimessage.
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Delivery report retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryReportResponse'
        '404':
          description: Omnimessage not found
  /omnimessages:
    post:
      tags:
      - Bulk Messaging
      summary: Sends a bulk Omnimessage
      description: Sends an Omnimessage to multiple recipients in a single request.
      operationId: sendBulkOmnimessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkOmnimessage'
      responses:
        '202':
          description: Bulk Omnimessage accepted for sending
        '400':
          description: Invalid input
  /phonebook/contacts:
    get:
      tags:
      - Contacts
      summary: Returns all contacts
      operationId: fetchContacts
      parameters:
      - name: groupIds
        in: query
        required: false
        description: Optional list of group IDs to filter contacts by.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: A list of contacts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListEnvelope'
    post:
      tags:
      - Contacts
      summary: Creates a new contact
      operationId: createContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactFields'
      responses:
        '201':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactEnvelope'
  /phonebook/contacts/{phone}:
    get:
      tags:
      - Contacts
      summary: Lists a contact
      operationId: fetchContact
      parameters:
      - $ref: '#/components/parameters/Phone'
      responses:
        '200':
          description: A contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactEnvelope'
    patch:
      tags:
      - Contacts
      summary: Updates a contact
      operationId: updateContact
      parameters:
      - $ref: '#/components/parameters/Phone'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUpdateFields'
      responses:
        '200':
          description: Contact updated
    delete:
      tags:
      - Contacts
      summary: Deletes a contact
      operationId: deleteContact
      parameters:
      - $ref: '#/components/parameters/Phone'
      responses:
        '204':
          description: Contact deleted
  /phonebook/contacts/{phone}/groups:
    get:
      tags:
      - Contacts
      summary: Lists a contact's group memberships
      operationId: fetchContactGroups
      parameters:
      - $ref: '#/components/parameters/Phone'
      responses:
        '200':
          description: Group memberships for the contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupListEnvelope'
  /phonebook/groups/{groupId}/contacts/{phone}:
    post:
      tags:
      - Contacts
      summary: Adds a contact to a group
      operationId: addContactToGroup
      parameters:
      - $ref: '#/components/parameters/GroupId'
      - $ref: '#/components/parameters/Phone'
      responses:
        '200':
          description: Contact added to group
    delete:
      tags:
      - Contacts
      summary: Removes a contact from a group
      operationId: removeContactFromGroup
      parameters:
      - $ref: '#/components/parameters/GroupId'
      - $ref: '#/components/parameters/Phone'
      responses:
        '204':
          description: Contact removed from group
  /phonebook/groups:
    get:
      tags:
      - Groups
      summary: Returns all groups
      operationId: fetchGroups
      responses:
        '200':
          description: A list of groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupListEnvelope'
    post:
      tags:
      - Groups
      summary: Creates a new group
      operationId: createGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupName'
      responses:
        '201':
          description: Group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupEnvelope'
  /phonebook/groups/{groupId}:
    get:
      tags:
      - Groups
      summary: Lists a group
      operationId: fetchGroup
      parameters:
      - $ref: '#/components/parameters/GroupId'
      responses:
        '200':
          description: A group
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupEnvelope'
    put:
      tags:
      - Groups
      summary: Updates a group
      operationId: updateGroup
      parameters:
      - $ref: '#/components/parameters/GroupId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupName'
      responses:
        '200':
          description: Group updated
    delete:
      tags:
      - Groups
      summary: Deletes a group
      operationId: deleteGroup
      parameters:
      - $ref: '#/components/parameters/GroupId'
      responses:
        '204':
          description: Group deleted
  /phonebook/blacklist:
    get:
      tags:
      - Blacklist
      summary: Returns all blacklisted phone numbers
      operationId: fetchBlacklist
      responses:
        '200':
          description: The blacklist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchBlacklistSuccess'
    post:
      tags:
      - Blacklist
      summary: Adds a phone number to the blacklist
      operationId: addToBlacklist
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NumberToBlacklist'
      responses:
        '201':
          description: Number added to blacklist
  /phonebook/blacklist/{phone}:
    get:
      tags:
      - Blacklist
      summary: Checks if a phone number is blacklisted
      operationId: isBlacklisted
      parameters:
      - $ref: '#/components/parameters/Phone'
      responses:
        '204':
          description: Number is blacklisted
        '404':
          description: Number is not blacklisted
    delete:
      tags:
      - Blacklist
      summary: Removes a phone number from the blacklist
      operationId: deleteFromBlacklist
      parameters:
      - $ref: '#/components/parameters/Phone'
      responses:
        '204':
          description: Number removed from blacklist
  /hlr/sync:
    post:
      tags:
      - Number Lookup
      summary: Requests phone number information (HLR lookup)
      description: >-
        Performs a synchronous HLR lookup returning network, roaming, and
        portability information for one or more phone numbers.
      operationId: fetchInfoSync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NumbersToInvestigate'
      responses:
        '200':
          description: Number lookup results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncNumberLookupSuccess'
  /verify/start:
    post:
      tags:
      - Number Verification
      summary: Initiates phone number verification
      description: Sends a PIN code to a phone number to begin verification.
      operationId: verifyNumber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Omnimessage'
      responses:
        '200':
          description: Verification initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OmniMessageCreateSuccessResponse'
  /verify/pin:
    post:
      tags:
      - Number Verification
      summary: Verifies a PIN code
      description: Checks a PIN entered by the user against a verification session.
      operationId: verifyPin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                verificationId:
                  type: string
                  format: uuid
                pin:
                  type: string
      responses:
        '200':
          description: PIN verified
        '400':
          description: Invalid or expired PIN
  /statistics/reports:
    post:
      tags:
      - Statistics
      summary: Requests statistics reports by country
      operationId: createStatisticsReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StatisticsReportSettings'
      responses:
        '200':
          description: Statistics report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatisticsReportSuccess'
  /pricelist:
    get:
      tags:
      - Pricing
      summary: Retrieves the account pricelist
      operationId: getPricelist
      responses:
        '200':
          description: The account pricelist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceInfo'
  /prices:
    get:
      tags:
      - Pricing
      summary: Gets prices for a specific country
      operationId: getPrices
      parameters:
      - name: country
        in: query
        required: true
        description: Two-letter ISO 3166-1 alpha-2 country code.
        schema:
          type: string
      responses:
        '200':
          description: Prices for the country
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceInfo'
  /get_balance:
    get:
      tags:
      - Account Balance
      summary: Retrieves the account balance
      operationId: getAccountBalance
      responses:
        '200':
          description: Account balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountBalance'
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic authentication using the API username and password from the
        Messente dashboard API settings.
  parameters:
    Phone:
      name: phone
      in: path
      required: true
      description: A phone number in international E.164 format.
      schema:
        type: string
    GroupId:
      name: groupId
      in: path
      required: true
      description: The identifier of the group.
      schema:
        type: string
        format: uuid
  schemas:
    Omnimessage:
      type: object
      description: >-
        A message delivered over one or more channels. The messages array
        defines the fallback chain in priority order.
      required:
      - to
      - messages
      properties:
        to:
          type: string
          description: Recipient phone number in international E.164 format.
        messages:
          type: array
          description: Ordered list of channel-specific messages forming the fallback chain.
          items:
            oneOf:
            - $ref: '#/components/schemas/SMS'
            - $ref: '#/components/schemas/Viber'
            - $ref: '#/components/schemas/WhatsApp'
        text_store:
          type: string
          enum:
          - nostore
          - plaintext
          - sha256
    SMS:
      type: object
      description: An SMS channel message.
      required:
      - text
      properties:
        channel:
          type: string
          enum:
          - sms
          default: sms
        sender:
          type: string
          description: Sender ID.
        text:
          type: string
        validity:
          type: integer
          description: Message validity period in minutes.
        autoconvert:
          type: string
          enum:
          - full
          - "on"
          - "off"
    Viber:
      type: object
      description: A Viber channel message.
      required:
      - text
      properties:
        channel:
          type: string
          enum:
          - viber
          default: viber
        sender:
          type: string
        text:
          type: string
        image_url:
          type: string
        button_url:
          type: string
        button_text:
          type: string
        validity:
          type: integer
    WhatsApp:
      type: object
      description: A WhatsApp channel message.
      properties:
        channel:
          type: string
          enum:
          - whatsapp
          default: whatsapp
        sender:
          type: string
        text:
          $ref: '#/components/schemas/WhatsAppText'
    WhatsAppText:
      type: object
      properties:
        body:
          type: string
        preview_url:
          type: boolean
    BulkOmnimessage:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Omnimessage'
    OmniMessageCreateSuccessResponse:
      type: object
      properties:
        messages:
          type: array
          items:
            type: object
            properties:
              channel:
                type: string
              message_id:
                type: string
              sender:
                type: string
        to:
          type: string
        omnimessage:
          type: string
          format: uuid
    DeliveryReportResponse:
      type: object
      properties:
        statuses:
          type: array
          items:
            type: object
            properties:
              channel:
                type: string
              message_id:
                type: string
              sender:
                type: string
              status:
                type: string
              err:
                type: string
        to:
          type: string
        omnimessage_id:
          type: string
          format: uuid
    ContactFields:
      type: object
      required:
      - phoneNumber
      properties:
        phoneNumber:
          type: string
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        company:
          type: string
        title:
          type: string
        custom:
          type: string
        custom2:
          type: string
        custom3:
          type: string
        custom4:
          type: string
    ContactUpdateFields:
      type: object
      properties:
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        company:
          type: string
        title:
          type: string
    ContactResponseFields:
      allOf:
      - $ref: '#/components/schemas/ContactFields'
      - type: object
        properties:
          scheduledDeletionDate:
            type: string
    ContactEnvelope:
      type: object
      properties:
        contact:
          $ref: '#/components/schemas/ContactResponseFields'
    ContactListEnvelope:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactResponseFields'
    GroupName:
      type: object
      required:
      - name
      properties:
        name:
          type: string
    GroupResponseFields:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        contactsCount:
          type: integer
        createdOn:
          type: string
    GroupEnvelope:
      type: object
      properties:
        group:
          $ref: '#/components/schemas/GroupResponseFields'
    GroupListEnvelope:
      type: object
      properties:
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupResponseFields'
    NumberToBlacklist:
      type: object
      required:
      - phoneNumber
      properties:
        phoneNumber:
          type: string
    FetchBlacklistSuccess:
      type: object
      properties:
        phoneNumbers:
          type: array
          items:
            type: object
            properties:
              phoneNumber:
                type: string
    NumbersToInvestigate:
      type: object
      required:
      - numbers
      properties:
        numbers:
          type: array
          items:
            type: string
    SyncNumberLookupResult:
      type: object
      properties:
        number:
          type: string
        roaming:
          type: boolean
        ported:
          type: boolean
        roamingNetwork:
          $ref: '#/components/schemas/MobileNetwork'
        originalNetwork:
          $ref: '#/components/schemas/MobileNetwork'
        currentNetwork:
          $ref: '#/components/schemas/MobileNetwork'
        error:
          type: string
        status:
          type: string
    SyncNumberLookupSuccess:
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/SyncNumberLookupResult'
    MobileNetwork:
      type: object
      properties:
        mcc:
          type: string
        mnc:
          type: string
        networkName:
          type: string
        countryName:
          type: string
        countryPrefix:
          type: string
    StatisticsReportSettings:
      type: object
      properties:
        startDate:
          type: string
        endDate:
          type: string
        mccmnc:
          type: array
          items:
            type: string
    StatisticsReport:
      type: object
      properties:
        country:
          type: string
        mccmnc:
          type: string
        sent:
          type: integer
        delivered:
          type: integer
        failed:
          type: integer
    StatisticsReportSuccess:
      type: object
      properties:
        reports:
          type: array
          items:
            $ref: '#/components/schemas/StatisticsReport'
    Price:
      type: object
      properties:
        mcc:
          type: string
        mnc:
          type: string
        networkName:
          type: string
        price:
          type: number
        currency:
          type: string
    PriceInfo:
      type: object
      properties:
        prices:
          type: array
          items:
            $ref: '#/components/schemas/Price'
    AccountBalance:
      type: object
      properties:
        balance:
          type: number
        currency:
          type: string