openapi: 3.1.2
info:
  title: Intellipush REST API
  version: 1.7.0
  description: |
    > **Live production API:** **Try it out** can change customer data, send
    > messages and consume credits on `api.intellipush.com`.

    ## Start in three steps

    1. Create credentials in [API settings](https://portal.intellipush.com/en/settings/api).
    2. POST `grant_type=client_credentials` to `/restv2/token`, authenticating
       with API ID and Secret through HTTP Basic.
    3. Send `Authorization: Bearer <access_token>` and `Accept:
       application/json` to protected operations.

    This is a confidential server-to-server flow. Tokens are opaque, last
    3,600 seconds and have no refresh token. Never expose secrets or tokens in
    URLs, browser code or logs.

    ## Essential API behavior

    - Use a full international phone number, or a `+` calling code and national
      number. Dates are `YYYY-MM-DD`; scheduled times are account-local `HH:MM`.
    - SMS creation means queued, not delivered. Batches accept 1-999 items;
      normalization and segmentation can make one message use several credits.
    - Pagination is one-based. Each operation documents its limits.
    - `X-Request-ID` is safe to record for support; it is not a credential or
      idempotency value.
    - For SMS creation retries, send a caller-generated `Idempotency-Key`.
      The same key and request replay the stored result for 24 hours without
      creating or charging another message.
    - `/capabilities` reports enabled features and limits. `/sms/quote` is a
      read-only prepaid or invoice estimate.
    - `/statistics/messages` groups usage by channel; `channels.sms` separates
      recipient messages from billable segments.
    - `/events` is a tenant-scoped cursor feed. Start with `cursor=latest`, then
      persist `next_cursor`. Retention is 30 days.

    ## HTTP response status codes

    | HTTP status | Meaning |
    | --- | --- |
    | `200` | The request completed or was accepted. SMS acceptance is not a delivery confirmation. |
    | `400` | Invalid input, a business-rule failure or an OAuth token-request error. |
    | `401` | Authentication is missing, expired or invalid. |
    | `403` | Authentication succeeded, but the client is not permitted to perform the operation. |
    | `405` | The HTTP method is not supported for the resource. |
    | `409` | An idempotency key is already in progress or was reused with different request data. |
    | `410` | An event cursor is older than the retained event window. |
    | `422` | A structurally valid quote could not produce any successful item. |
    | `5XX` | An unexpected server failure occurred. |

    The HTTP status is authoritative. REST resource errors normally include a
    legacy integer `errorcode`; OAuth errors use `error` and
    `error_description`. Treat `status_message` as human-readable text, not a
    stable programmatic value.

    ## Delivery receipt status codes

    Callback `status_code` is a delivery result, not an HTTP status.

    | Code | Delivery result | Code | Delivery result |
    | --- | --- | --- | --- |
    | `100` | Message is in transit and not yet delivered. | `200` | Message was successfully delivered to the recipient. |
    | `400` | Message failed for an unknown reason. | `401` | Message was rejected. |
    | `402` | Message could not be delivered. | `403` | Message failed because billing failed. |
    | `404` | Recipient has insufficient funds. | `405` | Recipient is temporarily barred. |
    | `406` | Recipient is too young. | `407` | Recipient is barred. |
    | `408` | Recipient is reserved against receiving overcharged content. | `500` | Recipient does not appear to exist. |
    | `501` | Message expired in the operator network. | | |

    Return HTTP `200` promptly; the body is ignored and other outcomes can be
    retried. Callback `time` is an opaque legacy marker. See **Webhooks** for
    fields, retries and security guidance.
  termsOfService: https://portal.intellipush.com/en/terms
  contact:
    name: Intellipush support
    email: info@intellipush.com
    url: https://www.intellipush.com/en/contact-us/
  license:
    name: Intellipush API Terms
    url: https://portal.intellipush.com/en/terms
externalDocs:
  description: Intellipush website
  url: https://www.intellipush.com/en/
servers:
- url: https://api.intellipush.com/restv2
  description: Live production API
tags:
- name: user
  description: Read the authenticated account and manage owned subaccounts.
- name: sms
  description: Create, schedule, update, list, delete and inspect SMS notifications.
- name: contact
  description: Create, update, search and delete contacts owned by the account.
- name: contact list
  description: Create, update, search and manage contact lists and memberships.
- name: url
  description: Create trackable short URLs and inspect visit information.
- name: twofactor
  description: Generate and validate one-time codes delivered over SMS.
- name: statistics
  description: Channel-aware message usage for the authenticated account.
- name: events
  description: Cursor-based message events for reliable integration polling.

paths:

  /token:
    post:
      tags:
      - user
      summary: Get OAuth 2.0 access token
      description: >
        Exchanges your API ID and API Secret for an OAuth 2.0 access token using
        the client credentials flow. Use HTTP Basic authentication and send
        grant_type=client_credentials as an application/x-www-form-urlencoded
        body. JSON and client credentials in the body remain accepted for
        legacy integrations, but new integrations should not use them. Tokens
        are opaque, expire after 3,600 seconds and have no refresh token. This
        `/restv2/token` is the canonical public token endpoint.
      operationId: createRestv2OauthToken
      security:
        - token_client_basic: []
        - {}
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OAuthTokenRequest'
            examples:
              preferredClientCredentials:
                summary: Preferred client credentials grant body
                value:
                  grant_type: client_credentials
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthTokenRequest'
            examples:
              legacyJsonCompatibility:
                summary: Legacy JSON compatibility body
                value:
                  grant_type: client_credentials
      responses:
        '200':
          description: OAuth 2.0 access token response
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Cache-Control:
              description: Prevents storage of the token response.
              schema:
                type: string
                example: no-store
            Pragma:
              description: Legacy cache-prevention directive.
              schema:
                type: string
                example: no-cache
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthTokenSuccess'
              examples:
                token:
                  value:
                    access_token: ip_at_example_opaque_token_not_for_authentication
                    expires_in: 3600
                    token_type: Bearer
                    scope: ''
        '400':
          $ref: '#/components/responses/OAuth400'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'


#####################################################################################
### USER
#####################################################################################
  /user:
    get:
      tags:
      - user 
      summary: Get the authorized user
      description:
        Returns the user account connected to the current OAuth 2.0 access token.
      operationId: user
      parameters: []
      responses:
        '200':
          description: Authenticated user account response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAccountSuccess'
              examples:
                account:
                  value:
                    success: true
                    data:
                      account_id: '42'
                      name: Example Company AS
                      smssendername: Intelli
                      countrycode: '+47'
                      phonenumber: '+4712345678'
                      timezonename: Europe/Oslo
                      sms_limit: 5000
                      centicredits: 250000
                      billing:
                        model: prepaid
                        currency: NOK
                        available_centicredits: 250000
                    status_message: Successfully got the user details.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /capabilities:
    get:
      tags:
      - user
      summary: Get account API capabilities
      description: |
        Returns the channels, additive REST features and operational limits
        currently available to the authenticated account. Integrations should
        use this response for capability discovery instead of assuming that an
        optional feature is enabled. Unfamiliar future properties can be
        ignored.
      operationId: getCapabilities
      parameters: []
      responses:
        '200':
          description: Account-specific API capabilities
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapabilitiesSuccess'
              examples:
                smsAccount:
                  value:
                    success: true
                    data:
                      account_id: '42'
                      channels: [sms]
                      permitted_scopes: [legacy_full_access]
                      features:
                        sms_quote: true
                        sms_senders: true
                        message_statistics: true
                        idempotency: false
                        event_feed: false
                        webhooks: false
                      limits:
                        sms_batch_recipients: 999
                      statistics_channels: [sms]
                    status_message: API capabilities fetched.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /user/createSubaccount:
    post:
      tags:
      - user
      summary: Create subaccount
      description:
        Creates a subaccount for the authenticated account. The API key and API secret are returned only in this creation response and cannot be retrieved later.
      operationId: createSubaccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubaccountCreate'
            examples:
              createSubaccount:
                value:
                  name: Oslo Store
                  sendername: OsloShop
                  sms_limit: 5000
      responses:
        '200':
          description: Subaccount created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubaccountCreateSuccess'
              examples:
                created:
                  value:
                    success: true
                    data:
                      subaccount_id: 974
                      name: Oslo Store
                      sendername: OsloShop
                      sms_limit: 5000
                      api_key: example_subaccount_api_id
                      api_secret: example_subaccount_secret_not_valid
                    status_message: The subaccount was successfully created.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /user/updateSubaccount:
    put:
      tags:
      - user
      summary: Update subaccount
      description:
        Updates the account name, sender name, and SMS limit for an owned
        subaccount selected by its API key. This endpoint never returns API
        secrets.
      operationId: updateSubaccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubaccountUpdate'
            examples:
              updateSubaccount:
                value:
                  api_key: '1234567'
                  name: Oslo Store Updated
                  sendername: OsloShop
                  sms_limit: 7500
      responses:
        '200':
          description: Subaccount updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubaccountUpdateSuccess'
              examples:
                updated:
                  value:
                    success: true
                    data:
                      subaccount_id: 974
                      name: Oslo Store Updated
                      sendername: OsloShop
                      sms_limit: 7500
                    status_message: The subaccount was successfully updated.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []
#####################################################################################



#####################################################################################
### SMS
#####################################################################################
  /sms/senders:
    get:
      tags:
      - sms
      summary: Get available SMS senders
      description: |
        Returns sender information available to the authenticated account.
        Numeric senders can support replies where the destination and account
        configuration permit it. Alphanumeric sender availability varies by
        destination and account configuration; a returned sender is not a
        guarantee that every mobile network will accept it.
      operationId: getSmsSenders
      parameters: []
      responses:
        '200':
          description: Available SMS sender information
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsSendersSuccess'
              examples:
                availableSenders:
                  value:
                    success: true
                    data:
                      senders:
                      - sender: Intelli
                        type: alphanumeric
                        is_default: true
                      custom_sender_supported: true
                      availability_note: Sender availability depends on account configuration and destination rules.
                    status_message: Available SMS sender information fetched.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/quote:
    post:
      tags:
      - sms
      summary: Quote an SMS request
      description: |
        Validates and normalizes one raw-phone SMS request or a batch of up to
        999 raw-phone requests, then estimates the charge using the account's
        current prepaid or invoice pricing. The operation is read-only: it does
        not create notifications, reserve credits or change balances.

        `input_segments` describes the submitted text, `segments` describes
        the normalized message and `billing_segments` is the segment count the
        existing sending path would charge. Monetary estimates exclude VAT and
        can change if account or operator pricing changes before sending.
      operationId: quoteSms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsQuoteRequest'
            examples:
              singlePrepaid:
                summary: Quote one immediate SMS
                value:
                  message: Your appointment is confirmed.
                  countrycode: '+47'
                  phonenumber: '90000000'
                  date: now
                  time: now
              batch:
                summary: Quote two SMS messages
                value:
                  batch:
                  - message: Your appointment is confirmed.
                    countrycode: '+47'
                    phonenumber: '90000000'
                    date: now
                    time: now
                  - message: Your access code is 12345.
                    countrycode: '+46'
                    phonenumber: '700000000'
                    date: now
                    time: now
      responses:
        '200':
          description: At least one quote item was calculated successfully
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsQuoteSuccess'
              examples:
                prepaid:
                  summary: Prepaid estimate
                  value:
                    success: true
                    data:
                      items:
                      - index: 0
                        success: true
                        normalized_message: Your appointment is confirmed.
                        input_encoding: GSM-7
                        encoding: GSM-7
                        character_count: 30
                        input_segments: 1
                        segments: 1
                        billing_segments: 1
                        recipients: 1
                        countrycode: '0047'
                        phonenumber: '90000000'
                        sender: Intelli
                        billing_model: prepaid
                        estimated_charge:
                          amount: '100'
                          unit: centicredits
                          currency: null
                      recipients: 1
                      segments: 1
                      billing_model: prepaid
                      estimated_charge:
                        amount: '100'
                        unit: centicredits
                        currency: null
                    status_message: SMS quote calculated without creating notifications.
                invoice:
                  summary: Invoice estimate
                  value:
                    success: true
                    data:
                      items:
                      - index: 0
                        success: true
                        normalized_message: Your appointment is confirmed.
                        input_encoding: GSM-7
                        encoding: GSM-7
                        character_count: 30
                        input_segments: 1
                        segments: 1
                        billing_segments: 1
                        recipients: 1
                        countrycode: '0047'
                        phonenumber: '90000000'
                        sender: Intelli
                        billing_model: invoice
                        estimated_charge:
                          amount: '0.445'
                          unit: money
                          currency: NOK
                      recipients: 1
                      segments: 1
                      billing_model: invoice
                      estimated_charge:
                        amount: '0.445'
                        unit: money
                        currency: NOK
                    status_message: SMS quote calculated without creating notifications.
        '400':
          description: The request or batch structure is invalid
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdditiveApiError'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '422':
          description: Every quote item failed validation
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsQuoteError'
        '503':
          description: The account price required for the estimate is unavailable or inconsistent
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsQuoteError'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/create:
    post:
      tags:
      - sms 
      summary: Create SMS
      description: |
        Creates an SMS for immediate or scheduled sending. Supply exactly one
        target: a raw phone number, a contact, or a contact list.

        For contact-list sends, `[CONTACT_NAME]` in the message is replaced
        with each contact's name. Accepted notifications are queued; creation
        does not confirm handset delivery. Text is normalized to the supported
        GSM-compatible character set, segmentation affects credit use, and
        sending can consume account credits. For safe retries after an
        ambiguous network failure, supply `Idempotency-Key`. Reusing the same
        key with the same accepted fields within 24 hours returns the stored
        result without creating or charging another notification.
      operationId: createSms
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsCreateRequest'
            examples:
              singlePhone:
                summary: Send to one phone number
                value:
                  message: Your appointment is confirmed.
                  countrycode: '+47'
                  phonenumber: '12345678'
              contactList:
                summary: Send to a contact list
                value:
                  message: Hi [CONTACT_NAME], your order is ready.
                  contactlistId: 67890
      responses:
        '200':
          description: SMS notification created
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Idempotency-Key:
              $ref: '#/components/headers/IdempotencyKey'
            Idempotency-Replayed:
              $ref: '#/components/headers/IdempotencyReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsCreateSuccess'
              examples:
                created:
                  value:
                    success: true
                    data:
                      id: 1210966
                      message: Your appointment is confirmed.
                      countrycode: '+47'
                      phonenumber: '+4712345678'
                      timesendt: '2026-05-21 14:24:00'
                      sent: 0
                      failed: 0
                      deleted: 0
                    status_message: SMS was created successfully.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '409':
          $ref: '#/components/responses/IdempotencyConflictOrInProgress'
        '503':
          $ref: '#/components/responses/IdempotencyUnavailable'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/createBatch:
    post:
      tags:
      - sms 
      summary: Create SMS batch
      description: |
        Creates between 1 and 999 SMS notifications in one transaction. Each
        item must identify a raw recipient with `phonenumber`; `countrycode`
        is needed when the number is national rather than fully international.
        Every item must include both `date` and `time`. Use `now` for both
        fields for immediate delivery. Contact and contact-list targets are not
        accepted. Text normalization and segmentation follow the single-SMS
        operation, and sending can consume account credits. For safe retries,
        supply one `Idempotency-Key` for the complete ordered batch. Reusing
        the same key and batch within 24 hours returns the stored result without
        creating or charging the batch again.
      operationId: createSmsBatch
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsBatchRequest'
            examples:
              twoMessages:
                summary: Batch with two recipients
                value:
                  batch:
                    - message: Your appointment is confirmed.
                      countrycode: '+47'
                      phonenumber: '12345678'
                      date: now
                      time: now
                    - message: Your order is ready.
                      countrycode: '+47'
                      phonenumber: '+4798765432'
                      date: now
                      time: now
      responses:
        '200':
          description: SMS batch created
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Idempotency-Key:
              $ref: '#/components/headers/IdempotencyKey'
            Idempotency-Replayed:
              $ref: '#/components/headers/IdempotencyReplayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsBatchSuccess'
              examples:
                created:
                  value:
                    success: true
                    data:
                      - success: true
                        data:
                          id: 1210966
                          message: Your appointment is confirmed.
                          countrycode: '+47'
                          phonenumber: '+4712345678'
                          sent: 0
                          failed: 0
                          deleted: 0
                        status_message: SMS was created successfully.
                      - success: true
                        data:
                          id: 1210967
                          message: Your order is ready.
                          countrycode: '+47'
                          phonenumber: '+4798765432'
                          sent: 0
                          failed: 0
                          deleted: 0
                        status_message: SMS was created successfully.
                    status_message: Your batch was successfully executed.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '409':
          $ref: '#/components/responses/IdempotencyConflictOrInProgress'
        '503':
          $ref: '#/components/responses/IdempotencyUnavailable'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/getPlanned:
    get:
      tags:
      - sms 
      summary: Get planned SMS
      description:
        Returns one planned SMS notification that has not been sent yet.
      operationId: smsGetPlanned
      parameters:
        - in: query
          name: id
          description: Planned SMS notification ID.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 1210966
      responses:
        '200':
          description: SMS notification response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsNotificationSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/update:
    put:
      tags:
      - sms 
      summary: Update SMS
      description:
        Updates a planned SMS notification before it is sent. Already sent notifications cannot be updated.
      operationId: updateSms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsUpdateRequest'
            examples:
              updatePlanned:
                summary: Update a planned SMS
                value:
                  id: 1210966
                  message: Your appointment has moved to 15:00.
                  countrycode: '+47'
                  phonenumber: '12345678'
                  date: '2026-05-22'
                  time: '15:00'
      responses:
        '200':
          description: SMS notification response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsNotificationSuccess'
              examples:
                updated:
                  value:
                    success: true
                    data:
                      id: 1210966
                      message: Your appointment has moved to 15:00.
                      countrycode: '+47'
                      phonenumber: '+4712345678'
                      date: '2026-05-22'
                      time: '15:00'
                      sent: 0
                      failed: 0
                      deleted: 0
                    status_message: OK
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/delete:
    delete:
      tags:
      - sms 
      summary: Delete SMS
      description:
        Deletes a planned SMS notification before it is sent. Already sent notifications remain available through status and list endpoints.
      operationId: deleteSms
      parameters:
        - in: query
          name: id
          description: Planned SMS notification ID to delete.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 1210966
      responses:
        '200':
          description: SMS notification response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsNotificationSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []


  /sms/status:
    post:
      tags:
      - sms 
      summary: Get notification status
      description: >
        Returns delivery/status information for one or more notification IDs.
        The endpoint is notification-ID based and can return status for both SMS
        and email notifications. For contact-list or multi-recipient campaigns,
        target and countrycode are intentionally returned as empty strings.
        Email notifications return countrycode as an empty string and
        number_of_sms as 0.
      operationId: smsStatus
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsStatusRequest'
            examples:
              array:
                summary: Preferred format with multiple IDs
                value:
                  id_array: [1210966, 1210967]
              singleString:
                summary: Backward-compatible single ID as string
                value:
                  id_array: "1210966"
              singleId:
                summary: Single ID alias
                value:
                  id: 1210966
      responses:
        '200':
          description: Notification status response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsStatusSuccess'
              examples:
                mixedStatus:
                  value:
                    success: true
                    data:
                      '1210966':
                        id: 1210966
                        sent: 1
                        failed: 0
                        tries: 1
                        deleted: 0
                        timesendt: '2026-05-21 14:24:00'
                        sent_to_operator: 1
                        confirmed_delivered: 1
                        method: sms
                        sender_name: Intelli
                        target: '+4712345678'
                        countrycode: '+47'
                        number_of_sms: 1
                      '1210967':
                        id: 1210967
                        sent: 1
                        failed: 0
                        tries: 1
                        deleted: 0
                        timesendt: '2026-05-21 14:25:00'
                        sent_to_operator: 1
                        confirmed_delivered: 0
                        method: email
                        sender_name: Intellipush
                        target: kari@example.com
                        countrycode: ''
                        number_of_sms: 0
                    status_message: OK
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/getUnsent:
    get:
      tags:
      - sms 
      summary: Get unsent SMS messages
      description: Returns planned SMS notifications that have not been sent yet. Use items and page for pagination.
      operationId: smsGetUnsent
      parameters:
        - in: query
          name: items
          description: Number of notifications per page. Invalid or omitted values use the legacy default of 501.
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 501
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
      responses:
        '200':
          description: SMS list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsListSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/getSent:
    get:
      tags:
      - sms 
      summary: Get sent SMS messages
      description: Returns sent SMS notifications for the authenticated account. Use items and page for pagination.
      operationId: smsGetSent
      parameters:
        - in: query
          name: items
          description: Number of notifications per page. Invalid or omitted values use the legacy default of 501.
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 501
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
      responses:
        '200':
          description: SMS list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsListSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /sms/getReceived:
    get:
      tags:
      - sms 
      summary: Get received SMS messages
      description: Returns inbound SMS replies received by the account. The optional keyword parameter filters replies by inbound keyword.
      operationId: smsGetReceived
      parameters:
        - in: query
          name: items
          description: Number of inbound messages per page. Invalid or omitted values use the legacy default of 501.
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 501
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: keyword
          description: Optional primary inbound keyword filter.
          schema:
            type: string
            default: ''
        - in: query
          name: secondKeyword
          description: Optional secondary inbound keyword filter.
          schema:
            type: string
            default: ''
        - in: query
          name: order
          description: Legacy result ordering column; unsupported values fall back to `id`.
          schema:
            type: string
            default: id
      responses:
        '200':
          description: Received SMS list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsReceivedListSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

#####################################################################################




#####################################################################################
### CONTACT
#####################################################################################
  /contact/create:
    post:
      tags:
      - contact 
      summary: Create a new contact
      description: Creates one contact in the authenticated account. Contacts can later be used as SMS recipients or added to contact lists.
      operationId: createContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactRequest'
            examples:
              norwegianContact:
                value:
                  name: Kari Nordmann
                  countrycode: '+47'
                  phonenumber: '+4712345678'
                  email: kari@example.com
                  company: Example Company AS
      responses:
        '200':
          description: Contact response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMutationSuccess'
              examples:
                created:
                  value:
                    success: true
                    data:
                      id: 12345
                      name: Kari Nordmann
                      countrycode: '+47'
                      phonenumber: '+4712345678'
                      email: kari@example.com
                      company: Example Company AS
                    status_message: OK
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contact/update:
    put:
      tags:
      - contact 
      summary: Update a contact
      description: Updates an existing contact owned by the authenticated account.
      operationId: updateContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactUpdateRequest'
            examples:
              updateContact:
                value:
                  id: 12345
                  name: Kari Nordmann
                  countrycode: '+47'
                  phonenumber: '+4712345678'
                  email: kari.nordmann@example.com
      responses:
        '200':
          description: Contact response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactMutationSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contact/get:
    get:
      tags:
      - contact 
      summary: Get a contact by contact ID
      description: Returns one contact by ID if it belongs to the authenticated account.
      operationId: getContact
      parameters:
        - in: query
          name: id
          description: Contact ID to retrieve.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 12345
      responses:
        '200':
          description: Contact response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactLookupSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contact/getContacts:
    get:
      tags:
      - contact 
      summary: Get multiple contacts
      description: Returns paginated contacts. The optional query parameter searches contact names.
      operationId: getContacts
      parameters:
        - in: query
          name: items
          description: Number of contacts per page.
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 20
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: query
          description: Optional UTF-8 contact search string, up to 100 characters.
          schema:
            type: string
            maxLength: 100
            default: ''
        - in: query
          name: order
          description: Contact field used for ordering.
          schema:
            type: string
            enum: [id, name, phonenumber, email, sex]
            default: id
        - in: query
          name: sort
          description: Sort direction.
          schema:
            type: string
            enum: [asc, desc]
            default: asc
        - in: query
          name: contactFilter
          description: Optional legacy contact-list filter payload. Prefer direct contact-list operations for new integrations.
          deprecated: true
          schema:
            oneOf:
              - type: string
              - type: object
                additionalProperties: true
      responses:
        '200':
          description: Contact search response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactSearchSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contact/delete:
    delete:
      tags:
      - contact 
      summary: Delete contact
      description: Deletes one contact from the authenticated account by contact ID.
      operationId: deleteContact
      parameters:
        - in: query
          name: id
          description: Contact ID to delete.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 12345
      responses:
        '200':
          description: Contact response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactDeleteSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []
#####################################################################################



#####################################################################################
### CONTACT LIST
#####################################################################################
  /contactList/create:
    post:
      tags:
      - contact list 
      summary: Create a new contact list
      description: Creates an empty contact list. Add contacts with /contactList/addContact.
      operationId: createContactList
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactListRequest'
            examples:
              newList:
                value:
                  name: Customers Norway
      responses:
        '200':
          description: Contact list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListSingleSuccess'
              examples:
                created:
                  value:
                    success: true
                    data:
                      id: 67890
                      list_name: Customers Norway
                    status_message: Your contactlist was successfully created.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/update:
    put:
      tags:
      - contact list 
      summary: Update a contact list
      description: Updates the name of an existing contact list.
      operationId: updateContactList
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactListUpdateRequest'
            examples:
              renameList:
                value:
                  id: 67890
                  name: Customers Oslo
      responses:
        '200':
          description: Contact list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListSingleSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/get:
    get:
      tags:
      - contact list 
      summary: Get a contact list by contact list ID
      description: Returns one contact list if it belongs to the authenticated account. Supply `id`; deprecated ID aliases remain accepted.
      operationId: getContactList
      parameters:
        - in: query
          name: id
          description: Preferred contact-list ID parameter.
          schema:
            type: integer
            minimum: 1
          example: 67890
        - $ref: '#/components/parameters/DeprecatedContactlistIdSnake'
        - $ref: '#/components/parameters/DeprecatedContactlistIdCamel'
        - $ref: '#/components/parameters/DeprecatedContactListIdCamel'
      responses:
        '200':
          description: Contact list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListSingleSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/getContactLists:
    get:
      tags:
      - contact list
      summary: Get multiple contact lists
      description: Returns paginated contact lists. The optional query parameter searches list names.
      operationId: getContactLists
      parameters:
        - in: query
          name: items
          description: Number of contact lists per page.
          schema:
            type: integer
            minimum: 1
            maximum: 5000
            default: 20
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: query
          description: Optional UTF-8 contact-list name search, up to 100 characters.
          schema:
            type: string
            maxLength: 100
            default: ''
        - in: query
          name: sortcol
          description: Contact-list field used for ordering.
          schema:
            type: string
            enum: [id, list_name, time, owner_uid]
            default: list_name
        - in: query
          name: ascdesc
          description: Sort direction.
          schema:
            type: string
            enum: [asc, desc]
            default: desc
      responses:
        '200':
          description: Contact list search response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListSearchSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []


  /contactList/delete:
    delete:
      tags:
      - contact list 
      summary: Delete contact list
      description: Deletes one contact list. Supply `id`; deprecated ID aliases remain accepted. Contacts themselves are not deleted.
      operationId: deleteContactList
      parameters:
        - in: query
          name: id
          description: Preferred contact-list ID parameter.
          schema:
            type: integer
            minimum: 1
          example: 67890
        - $ref: '#/components/parameters/DeprecatedContactlistIdSnake'
        - $ref: '#/components/parameters/DeprecatedContactlistIdCamel'
        - $ref: '#/components/parameters/DeprecatedContactListIdCamel'
      responses:
        '200':
          description: Contact list response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListSingleSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/getContactsInContactlist:
    get:
      tags:
      - contact list
      summary: Get contacts in a contact list
      description: Returns paginated contacts in one list. Supply `id`; deprecated ID aliases remain accepted.
      operationId: getContactsInContactlist
      parameters:
        - in: query
          name: id
          description: Preferred contact-list ID parameter.
          schema:
            type: integer
            minimum: 1
          example: 67890
        - $ref: '#/components/parameters/DeprecatedContactlistIdSnake'
        - $ref: '#/components/parameters/DeprecatedContactlistIdCamel'
        - $ref: '#/components/parameters/DeprecatedContactListIdCamel'
        - in: query
          name: items
          description: Number of contacts per page.
          schema:
            type: integer
            minimum: 1
            maximum: 100000
            default: 20
        - in: query
          name: page
          description: One-based page number.
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: query
          description: Optional UTF-8 name or phone-number search, up to 100 characters.
          schema:
            type: string
            maxLength: 100
            default: ''
        - in: query
          name: sortcol
          description: Contact field used for ordering.
          schema:
            type: string
            enum: [id, name, phonenumber, email, sex]
            default: name
        - in: query
          name: ascdesc
          description: Sort direction.
          schema:
            type: string
            enum: [asc, desc]
            default: asc
        - in: query
          name: contactlist_filter
          description: Optional legacy contact-list filter payload.
          deprecated: true
          schema:
            oneOf:
              - type: string
              - type: object
                additionalProperties: true
      responses:
        '200':
          description: Contact-list membership response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListMembershipSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/addContact:
    post:
      tags:
      - contact list 
      summary: Add contact to contact list
      description: Adds an existing contact to an existing contact list.
      operationId: addContactToContactList
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactListMembershipChangeRequest'
            examples:
              addContact:
                value:
                  contactListId: 67890
                  contactId: 12345
      responses:
        '200':
          description: Contact-list membership update response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListMembershipChangeSuccess'
              examples:
                added:
                  value:
                    success: true
                    data:
                      id: 99102
                      contactlist_id: 67890
                      contact_id: 12345
                    status_message: The contact was added to the contactlist.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /contactList/removeContact:
    delete:
      tags:
      - contact list 
      summary: Remove contact from contact list
      description: Removes one contact from a list. Supply `contactListId`; deprecated ID aliases remain accepted. The contact remains available in the account.
      operationId: removeContactFromContactList
      parameters:
        - in: query
          name: contactListId
          description: Preferred contact-list ID parameter for membership operations.
          schema:
            type: integer
            minimum: 1
          example: 67890
        - $ref: '#/components/parameters/DeprecatedContactlistIdSnake'
        - $ref: '#/components/parameters/DeprecatedContactlistIdCamel'
        - in: query
          name: id
          description: Deprecated contact-list ID alias; use `contactListId`.
          deprecated: true
          schema:
            type: integer
            minimum: 1
        - in: query
          name: contactId
          description: Contact ID to remove from the list.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 12345
      responses:
        '200':
          description: Contact-list membership update response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListMembershipChangeSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

#####################################################################################



#####################################################################################
### URL
#####################################################################################
  /url/generate:
    post:
      tags:
      - url 
      summary: Create a short URL from a long URL
      description: Creates a trackable short URL for a long URL. Use the returned short URL in SMS campaigns to measure visits.
      operationId: generateShortUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShortUrlRequest'
            examples:
              campaignUrl:
                value:
                  url: https://www.intellipush.com/?utm_source=customer_base&utm_medium=sms&utm_campaign=summer_sale
      responses:
        '200':
          description: Short URL response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortUrlSuccess'
              examples:
                generated:
                  value:
                    success: true
                    data:
                      id: 24680
                      long_url: https://www.intellipush.com/?utm_source=customer_base&utm_medium=sms&utm_campaign=summer_sale
                      short_url: https://1p.nu/9C3c1S
                      created: '2026-05-21 09:12:00'
                    status_message: Successfully created short url.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /url/generateChild:
    post:
      tags:
      - url
      summary: Generate a child URL from parent
      description: Creates a recipient-specific child URL from an existing parent short URL. Use this when you need per-recipient tracking.
      operationId: generateChildShortUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShortUrlChildRequest'
            examples:
              phoneRecipient:
                value:
                  id: 24680
                  target:
                    countrycode: '+47'
                    phonenumber: '12345678'
              contactRecipient:
                value:
                  id: 24680
                  target:
                    contact_id: 12345
      responses:
        '200':
          description: Short URL response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortUrlSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /url/details:
    get:
      tags:
      - url 
      summary: Get short URL details and tracking statistics
      description: Returns the destination URL, short URL, visit counts, and recent visitor metadata for one short URL.
      operationId: getUrlDetails
      parameters:
        - in: query
          name: id
          description: Short URL ID to inspect.
          required: true
          schema:
            type: integer
            minimum: 1
          example: 24680

      responses:
        '200':
          description: Short URL details response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortUrlDetailsSuccess'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

#####################################################################################


#####################################################################################
### Two-Factor as a Service
#####################################################################################
  /twofactor/generate:
    post:
      tags:
      - twofactor 
      summary: Create and send a two-factor code
      description: |
        Generates a five-digit code and creates an SMS for the supplied phone
        number. This operation consumes SMS credits. If an unused code already
        exists, no new SMS is created and the endpoint returns the documented
        existing-code envelope. A newly generated code returns the legacy raw
        notification object instead of the standard response envelope.
      operationId: generate2FaCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwoFactorGenerateRequest'
            examples:
              generateCode:
                value:
                  countrycode: '+47'
                  phonenumber: '12345678'
                  message_pre_code: 'Your Intellipush code is: '
                  message_post_code: ' Do not share it.'
      responses:
        '200':
          description: Two-factor code generated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwoFactorGenerateSuccess'
              examples:
                newlyGenerated:
                  summary: New code and SMS notification created
                  value:
                    id: 1210966
                    single_target_countrycode: '+47'
                    single_target: '+4712345678'
                    text_message: ''
                    method: sms
                    when: '2026-05-21 09:17:00'
                existingCode:
                  summary: An unused code already exists
                  value:
                    success: true
                    data:
                      hasCode: true
                    status_message: A code is already sendt.
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /twofactor/validate:
    post:
      tags:
      - twofactor
      summary: Validate a previously generated code against a phone number
      description: |
        Validates a generated code for the supplied phone number. A successful
        match returns `data.access: true` and marks that code as used. Wrong,
        unavailable, or exhausted codes use the standard application-error
        response.
      operationId: validate2FaCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwoFactorValidateRequest'
            examples:
              validateCode:
                value:
                  countrycode: '+47'
                  phonenumber: '12345678'
                  code: '12345'
      responses:
        '200':
          description: Two-factor code validation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwoFactorValidateSuccess'
              examples:
                valid:
                  value:
                    success: true
                    data:
                      access: true
                    status_message: 'Success: Correct code entered.'
        '400':
          $ref: '#/components/responses/Default400'
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

#####################################################################################




#####################################################################################
### STATISTICS
#####################################################################################

  /statistics/messages:
    get:
      tags:
      - statistics
      summary: Get channel-aware message statistics
      description: |
        Returns inclusive daily and period usage for the authenticated account.
        The initial response contains only `channels.sms`: `recipient_messages`
        counts recipient message records and `sms_segments` is the billable SMS
        consumption unit. Every requested date is returned in chronological
        order, including zero-usage dates.

        Future channels can be added as sibling properties under `channels`
        without changing the SMS contract. Clients should ignore unfamiliar
        channel siblings. Country breakdown is SMS-specific and invalid or
        unavailable destination codes are grouped as `XX`.
      operationId: getMessageStatistics
      parameters:
        - in: query
          name: fromDate
          description: First UTC calendar date in the inclusive period. The complete period cannot exceed 366 days.
          required: true
          schema:
            type: string
            format: date
          example: '2026-08-01'
        - in: query
          name: toDate
          description: Last UTC calendar date in the inclusive period. It must not be earlier than `fromDate`.
          required: true
          schema:
            type: string
            format: date
          example: '2026-08-26'
      responses:
        '200':
          description: Channel-aware message statistics
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageStatisticsSuccess'
              examples:
                smsUsage:
                  value:
                    success: true
                    data:
                      from_date: '2026-08-01'
                      to_date: '2026-08-02'
                      channels:
                        sms:
                          totals:
                            recipient_messages: 52
                            consumption:
                              unit: sms_segments
                              quantity: 60
                            countries:
                            - country_code: 'NO'
                              recipient_messages: 52
                              consumption:
                                unit: sms_segments
                                quantity: 60
                          daily:
                          - date: '2026-08-01'
                            recipient_messages: 50
                            consumption:
                              unit: sms_segments
                              quantity: 58
                            countries:
                            - country_code: 'NO'
                              recipient_messages: 50
                              consumption:
                                unit: sms_segments
                                quantity: 58
                          - date: '2026-08-02'
                            recipient_messages: 2
                            consumption:
                              unit: sms_segments
                              quantity: 2
                            countries:
                            - country_code: 'NO'
                              recipient_messages: 2
                              consumption:
                                unit: sms_segments
                                quantity: 2
                    status_message: Message statistics fetched.
        '400':
          description: The date range is malformed, reversed or longer than 366 days
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdditiveApiError'
              examples:
                invalidRange:
                  value:
                    success: false
                    errorcode: invalid_date_range
                    status_message: Invalid statistics date range.
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

  /events:
    get:
      tags:
      - events
      summary: Get message events
      description: |
        Returns retained events for the authenticated account in ascending
        event-ID order. SMS delivery-state changes and incoming SMS messages
        are currently available; additional channels and event types can be
        added later.

        Begin with `cursor=latest` to obtain a checkpoint without receiving
        historical events. Poll again with the returned `next_cursor`, process
        the events in order, and persist `next_cursor` only after processing
        succeeds. Reusing a cursor can return the same events, so consumers
        must deduplicate by `event_id`. Events are retained for 30 days. If a
        cursor expires, the API returns HTTP `410`; restart from `latest` and
        reconcile current message state where necessary.

        Event capture is asynchronous and can normally lag source activity by
        up to approximately one minute. Polling more often than every 30
        seconds is unnecessary. Incoming event data can contain message text
        and phone numbers belonging to the authenticated account and must be
        handled as customer personal data.
      operationId: getMessageEvents
      parameters:
        - in: query
          name: channel
          description: Message channel to return. Only SMS events are currently available.
          required: false
          schema:
            type: string
            enum: [sms]
            default: sms
        - in: query
          name: cursor
          description: Use `latest` for an initial checkpoint or the `next_cursor` from the preceding successful response.
          required: false
          schema:
            oneOf:
              - type: string
                const: latest
              - type: string
                pattern: '^evt_[0-9]+$'
            default: latest
          example: evt_1250
        - in: query
          name: limit
          description: Maximum events returned in one page. Continue with `next_cursor` when a full page is returned.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
          example: 100
      responses:
        '200':
          description: Ordered event page and continuation cursor
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageEventsSuccess'
              examples:
                statusChanged:
                  value:
                    success: true
                    data:
                      channel: sms
                      events:
                        - event_id: evt_1251
                          type: sms.status_changed
                          channel: sms
                          occurred_at: '2026-09-02T08:15:12Z'
                          data:
                            notification_id: 'example-message-42'
                            recipient: '+4799999999'
                            status: delivered
                          original_provider_status: '2000'
                      next_cursor: evt_1251
                    status_message: Message events fetched.
                initialCheckpoint:
                  value:
                    success: true
                    data:
                      channel: sms
                      events: []
                      next_cursor: evt_1251
                    status_message: Message events fetched.
        '400':
          description: The channel or cursor is malformed or unsupported
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdditiveApiError'
              examples:
                invalidCursor:
                  value:
                    success: false
                    errorcode: invalid_cursor
                    status_message: The event cursor is invalid.
        '401':
          $ref: '#/components/responses/Default401'
        '403':
          $ref: '#/components/responses/Default403'
        '405':
          $ref: '#/components/responses/Default405'
        '410':
          description: The cursor is older than the retained event window
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdditiveApiError'
              examples:
                expiredCursor:
                  value:
                    success: false
                    errorcode: cursor_expired
                    status_message: The event cursor is older than the configured retention window.
        '5XX':
          $ref: '#/components/responses/Default5XX'
      security:
        - oauth2_client_credentials: []

webhooks:
  deliveryReceipt:
    get:
      summary: Receive an SMS delivery receipt
      description: |
        Intellipush sends this GET request to the delivery-receipt URL
        configured for the account. Existing query parameters on the customer
        URL are preserved. Intellipush considers only a completed HTTP `200`
        response successful; the response body is ignored. Other outcomes are
        retried by the current delivery queue.

        The `time` value is a legacy opaque numeric event marker derived from
        server time. It is not a documented Unix timestamp unit and must not be
        used as a precision clock. Use it only for correlation or ordering.

        Delivery receipts are currently unsigned. Treat every field as
        untrusted input, use HTTPS, and configure an unguessable callback URL
        or customer-controlled query secret where practical. Make the handler
        idempotent because a callback can be delivered more than once. Return
        HTTP `200` quickly after safely recording the event; only the status
        code is evaluated and the response body is ignored.
      operationId: receiveSmsDeliveryReceipt
      security: []
      parameters:
        - in: query
          name: id
          required: true
          description: Original Intellipush notification ID.
          schema:
            type: integer
            minimum: 1
          example: 1210966
        - in: query
          name: country_code
          required: true
          description: Recipient country calling code as stored by the delivery service.
          schema:
            type: string
          example: '+47'
        - in: query
          name: recipient
          required: true
          description: Recipient phone number.
          schema:
            type: string
          example: '+4712345678'
        - in: query
          name: time
          required: true
          description: Opaque legacy numeric event marker; no timestamp unit or precision is guaranteed.
          schema:
            type: string
            pattern: '^[0-9]+$'
          example: '17874270001234'
        - in: query
          name: status
          required: true
          description: Final normalized delivery outcome.
          schema:
            type: string
            enum: [DELIVERED, FAILED]
          example: DELIVERED
        - in: query
          name: status_message
          required: true
          description: Human-readable normalized delivery description.
          schema:
            type: string
          example: Message has been successfully delivered to recipient
        - in: query
          name: status_code
          required: true
          description: Legacy Intellipush normalized delivery result; this is not an HTTP response status.
          schema:
            $ref: '#/components/schemas/DeliveryReceiptStatusCode'
          example: 200
        - in: query
          name: s
          required: true
          description: Legacy delivery-receipt queue row identifier used for support correlation.
          schema:
            type: integer
            minimum: 1
          example: 99102
      responses:
        '200':
          description: Acknowledge successful receipt. The body is ignored.


components:
  parameters:
    DeprecatedContactlistIdSnake:
      in: query
      name: contactlist_id
      description: Deprecated contact-list ID alias; use the operation's preferred ID parameter.
      deprecated: true
      schema:
        type: integer
        minimum: 1
    DeprecatedContactlistIdCamel:
      in: query
      name: contactlistId
      description: Deprecated contact-list ID alias; use the operation's preferred ID parameter.
      deprecated: true
      schema:
        type: integer
        minimum: 1
    DeprecatedContactListIdCamel:
      in: query
      name: contactListId
      description: Deprecated contact-list ID alias; use the operation's preferred ID parameter.
      deprecated: true
      schema:
        type: integer
        minimum: 1
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      description: |
        Optional caller-generated key that makes this SMS creation request
        safely replayable for 24 hours. Use a new unpredictable key for each
        logical request and reuse it only when retrying the same accepted
        fields in the same order. Keys are scoped to the authenticated account,
        OAuth client and operation. They must contain 1-200 ASCII letters,
        digits, dots, underscores, colons or hyphens. Omitting this header
        preserves the established non-idempotent behavior.
      required: false
      schema:
        type: string
        minLength: 1
        maxLength: 200
        pattern: '^[A-Za-z0-9._:-]+$'
      example: msg_20260902_0123456789abcdef
  headers:
    RequestId:
      description: Server-generated request correlation identifier for support and sanitized logs.
      schema:
        type: string
        pattern: '^req_[a-f0-9]{32}$'
        example: req_0123456789abcdef0123456789abcdef
    IdempotencyKey:
      description: Echoes the supplied Idempotency-Key when idempotent processing was activated.
      schema:
        type: string
        minLength: 1
        maxLength: 200
        pattern: '^[A-Za-z0-9._:-]+$'
        example: msg_20260902_0123456789abcdef
    IdempotencyReplayed:
      description: True when this response was replayed from the stored result instead of creating another notification.
      schema:
        type: boolean
        example: false
    RetryAfter:
      description: Number of seconds to wait before retrying the same idempotent request.
      schema:
        type: integer
        minimum: 1
        example: 2
  responses:
    Default400:
      description: |
        Business or validation failure. REST v2 converts application results
        with `success: false` to HTTP 400; `errorcode` contains the more
        specific legacy application code.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            validationError:
              value:
                success: false
                errorcode: 406
                status_message: Invalid or missing request data.
    Default401:
      description: |
        Authentication failed. Depending on where authentication fails, the
        legacy runtime can return an OAuth 2.0 error object, a JSON string, or an
        empty body. Clients must use the HTTP status as authoritative.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticationError'
          examples:
            oauthError:
              value:
                error: invalid_token
                error_description: The access token provided is invalid
            legacyString:
              value: 401 Unauthorized
    Default403:
      description: |
        The access token was accepted but the account is not permitted to
        perform the operation. The legacy runtime can return an OAuth-style
        object, a JSON string, or an empty body; use HTTP 403 as authoritative.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthenticationError'
          examples:
            legacyString:
              value: 403 Forbidden
    Default405:
      description: |
        The resource exists, but the supplied HTTP method is not accepted. A
        response body is not guaranteed; use HTTP 405 as authoritative.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
    Default5XX:
      description: Unexpected server failure. A JSON response body is not guaranteed.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
    IdempotencyConflictOrInProgress:
      description: |
        The key is currently being processed, or it was already used for
        different accepted request data. Retry an in-progress request after
        `Retry-After` with the same key and unchanged data. A conflict requires
        a new key or correction of the caller's retry logic.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Idempotency-Key:
          $ref: '#/components/headers/IdempotencyKey'
        Idempotency-Replayed:
          $ref: '#/components/headers/IdempotencyReplayed'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AdditiveApiError'
          examples:
            inProgress:
              value:
                success: false
                errorcode: idempotency_in_progress
                status_message: The idempotent request is currently being processed.
            conflict:
              value:
                success: false
                errorcode: idempotency_conflict
                status_message: The Idempotency-Key was already used with a different request.
    IdempotencyUnavailable:
      description: Idempotent processing is temporarily unavailable. No SMS is created; retry later with the same key.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AdditiveApiError'
          examples:
            unavailable:
              value:
                success: false
                errorcode: idempotency_temporarily_unavailable
                status_message: The idempotent request could not be completed. Retry it with the same key.
    OAuth400:
      description: Invalid OAuth 2.0 client-credentials request.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Cache-Control:
          description: Prevents storage of the OAuth error response.
          schema:
            type: string
            example: no-store
        Pragma:
          description: Legacy cache-prevention directive.
          schema:
            type: string
            example: no-cache
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OAuthError'
          examples:
            unsupportedGrant:
              value:
                error: unsupported_grant_type
                error_description: Grant type not supported
            invalidClient:
              value:
                error: invalid_client
                error_description: The client credentials are invalid
  schemas:
    DeliveryReceiptStatusCode:
      description: |
        Legacy normalized delivery result supplied in the delivery-receipt
        callback. It is separate from the HTTP status returned by the customer
        callback endpoint.

        | Code | Delivery result |
        | --- | --- |
        | `100` | Message is in transit and not yet delivered. |
        | `200` | Message was successfully delivered to the recipient. |
        | `400` | Message failed for an unknown reason. |
        | `401` | Message was rejected. |
        | `402` | Message could not be delivered. |
        | `403` | Message failed because billing failed. |
        | `404` | Recipient has insufficient funds. |
        | `405` | Recipient is temporarily barred. |
        | `406` | Recipient is too young. |
        | `407` | Recipient is barred. |
        | `408` | Recipient is reserved against receiving overcharged content. |
        | `500` | Recipient does not appear to exist. |
        | `501` | Message expired in the operator network. |
      type: integer
      enum: [100, 200, 400, 401, 402, 403, 404, 405, 406, 407, 408, 500, 501]
      example: 200
    Error:
      description: Standard error envelope used by REST v2 endpoints.
      type: object
      required: [success, errorcode, status_message]
      properties:
        success:
          type: boolean
          description: Always false for this application-error envelope.
          example: false
        errorcode:
          type: integer
          description: Legacy application-specific error code.
          example: 406
        status_message:
          type: string
          description: Human-readable diagnostic text; it is not a stable machine code.
          example: Invalid or missing request data.
    OAuthError:
      description: OAuth 2.0 error response returned by the token service.
      type: object
      required: [error, error_description]
      properties:
        error:
          type: string
          description: OAuth 2.0 error code.
          example: invalid_client
        error_description:
          type: string
          description: Human-readable OAuth 2.0 error description.
          example: The client credentials are invalid
    AuthenticationError:
      description: Legacy authentication response; an empty body is also possible.
      oneOf:
        - $ref: '#/components/schemas/OAuthError'
        - type: string
          example: 401 Unauthorized

    OAuthTokenRequest:
      description: Request body for the OAuth 2.0 client credentials token endpoint.
      type: object
      required: [grant_type]
      properties:
        grant_type:
          type: string
          description: OAuth 2.0 grant type. REST v2 supports only client credentials.
          enum: [client_credentials]
          example: client_credentials
        client_id:
          type: string
          writeOnly: true
          deprecated: true
          description: Legacy body credential; use the API ID as the HTTP Basic username instead.
          example: example_api_id
        client_secret:
          type: string
          writeOnly: true
          deprecated: true
          description: Legacy body credential; use the API Secret as the HTTP Basic password instead.
          example: example_api_secret_not_valid
    OAuthTokenSuccess:
      description: OAuth 2.0 token response returned by the canonical /restv2/token endpoint.
      type: object
      required: [access_token, expires_in, token_type]
      properties:
        access_token:
          type: string
          description: Bearer token to use in the Authorization header for REST v2 requests.
          example: ip_at_example_opaque_token_not_for_authentication
        expires_in:
          type: integer
          description: Number of seconds until the access token expires.
          minimum: 1
          example: 3600
        token_type:
          type: string
          description: Token type used in the Authorization header.
          enum: [Bearer]
          example: Bearer
        scope:
          type: string
          description: Granted scope string. REST v2 currently returns an empty value and does not expose operation-specific scopes.
          example: ''

    UserAccount:
      description: |
        Non-secret account metadata returned for the authenticated user.
        Legacy accounts can include additional non-secret profile attributes.
      type: object
      required: [account_id, name, centicredits, billing]
      additionalProperties: true
      properties:
        account_id:
          type: string
          readOnly: true
          pattern: '^[0-9]+$'
          description: Stable effective account identifier. It does not change when an API Secret is rotated.
          example: '42'
        name:
          type: string
          description: Account or company name.
          example: Example Company AS
        smssendername:
          type: string
          description: Default SMS sender name configured for the account.
          example: Intelli
        countrycode:
          type: string
          description: Account phone-number country calling code.
          example: '+47'
        phonenumber:
          type: string
          description: Account contact phone number.
          example: '+4712345678'
        timezonename:
          type: string
          description: IANA timezone used for scheduling.
          example: Europe/Oslo
        sms_limit:
          type: integer
          description: Configured account SMS limit.
          example: 5000
        centicredits:
          description: Remaining account balance in centicredits, or an empty string when unavailable.
          oneOf:
            - type: integer
              minimum: 0
            - type: string
              enum: ['']
          example: 250000
        billing:
          $ref: '#/components/schemas/BillingSummary'
          description: Current account billing model and integration-safe balance information.
    BillingSummary:
      description: Billing information suitable for automated integrations while preserving the legacy centicredits field.
      type: object
      required: [model, currency, available_centicredits]
      properties:
        model:
          type: string
          enum: [prepaid, invoice]
          description: Whether SMS usage is deducted from prepaid credits or billed by invoice.
          example: prepaid
        currency:
          type: string
          pattern: '^[A-Z]{3}$'
          description: ISO 4217 account currency used for monetary pricing.
          example: NOK
        available_centicredits:
          type: [integer, 'null']
          minimum: 0
          description: Available prepaid centicredits, or null when a prepaid balance is not authoritative for an invoice account.
          example: 250000
    UserAccountSuccess:
      description: Successful authenticated-account lookup.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the account lookup succeeded.
          example: true
        data:
          $ref: '#/components/schemas/UserAccount'
          description: Non-secret attributes for the authenticated account.
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully got the user details.

    SubaccountCreate:
      description: Request body for creating a subaccount.
      type: object
      required: [name, sendername, sms_limit]
      properties:
        name:
          type: string
          example: Oslo Store
          description: Display name of the subaccount.
        sendername:
          type: string
          example: OsloShop
          description: Default sender name for the subaccount.
        sms_limit:
          type: integer
          minimum: 0
          example: 5000
          description: Maximum number of SMS messages the subaccount can send.
    SubaccountUpdate:
      description: Request body for updating an owned subaccount.
      type: object
      required: [api_key, name, sendername, sms_limit]
      properties:
        api_key:
          type: string
          minLength: 1
          example: '1234567'
          description: API key of the owned subaccount to update.
        name:
          type: string
          description: New display name of the subaccount.
          example: Oslo Store Updated
        sendername:
          type: string
          description: New default sender name for the subaccount.
          example: OsloShop
        sms_limit:
          type: integer
          minimum: 0
          description: New maximum number of SMS messages the subaccount can send.
          example: 7500
    SubaccountCreateData:
      description: Created subaccount attributes and credentials returned once at creation.
      type: object
      required: [subaccount_id, name, sendername, sms_limit, api_key, api_secret]
      properties:
        subaccount_id:
          type: integer
          description: Internal identifier of the newly created subaccount.
          example: 974
        name:
          type: string
          description: Display name of the subaccount.
          example: Oslo Store
        sendername:
          type: string
          description: Default sender name configured for the subaccount.
          example: OsloShop
        sms_limit:
          type: integer
          description: Configured SMS limit for the subaccount.
          example: 5000
        api_key:
          type: string
          example: example_subaccount_api_id
          description: API key for the created subaccount. Returned only on creation.
        api_secret:
          type: string
          readOnly: true
          example: example_subaccount_secret_not_valid
          description: API secret for the created subaccount. Returned only on creation.
    SubaccountUpdateData:
      description: Non-secret attributes returned after a subaccount update.
      type: object
      required: [subaccount_id, name, sendername, sms_limit]
      properties:
        subaccount_id:
          type: integer
          description: Internal identifier of the updated subaccount.
          example: 974
        name:
          type: string
          description: Updated display name of the subaccount.
          example: Oslo Store Updated
        sendername:
          type: string
          description: Updated default sender name.
          example: OsloShop
        sms_limit:
          type: integer
          description: Updated SMS limit.
          example: 7500
    SubaccountCreateSuccess:
      description: Successful subaccount creation, including one-time API credentials.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the subaccount was created.
          example: true
        data:
          $ref: '#/components/schemas/SubaccountCreateData'
          description: Created subaccount and its one-time credentials.
        status_message:
          type: string
          description: Human-readable result message.
          example: The subaccount was successfully created.
    SubaccountUpdateSuccess:
      description: Successful subaccount update.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the subaccount was updated.
          example: true
        data:
          $ref: '#/components/schemas/SubaccountUpdateData'
          description: Updated non-secret subaccount attributes.
        status_message:
          type: string
          description: Human-readable result message.
          example: The subaccount was successfully updated.

    SmsCreateRequest:
      description: Request body for creating an immediate or scheduled SMS notification.
      type: object
      required: [message]
      oneOf:
        - required: [phonenumber]
        - required: [contactId]
        - required: [contactlistId]
      properties:
        message:
          type: string
          minLength: 1
          example: Your appointment is confirmed.
          description: SMS message text. Unsupported characters are normalized to the platform's GSM-compatible character set, and segmentation can consume multiple credits.
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          example: '+47'
          description: Optional country calling code including the leading `+` when `phonenumber` is supplied as a national number.
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          example: '12345678'
          description: Recipient phone number for a raw-number SMS. Supply a complete international number, or provide a national number together with `countrycode`.
        date:
          type: string
          format: date
          example: '2026-05-21'
          description: Send date for scheduled SMS in the account timezone. Omit date and time for immediate sending.
        time:
          type: string
          pattern: '^([01]\d|2[0-3]):[0-5]\d$'
          example: '14:24'
          description: Send time for scheduled SMS in HH:MM format. If scheduling, provide both date and time.
        contactId:
          type: integer
          minimum: 1
          example: 12345
          description: Send to one existing contact instead of a raw phone number.
        contactlistId:
          type: integer
          minimum: 1
          example: 67890
          description: Send to all contacts in an existing contact list.
    SmsBatchItem:
      description: One raw-recipient SMS in a batch request.
      type: object
      required: [message, phonenumber, date, time]
      properties:
        message:
          type: string
          minLength: 1
          description: SMS message text. Unsupported characters are normalized to the platform's GSM-compatible character set, and segmentation can consume multiple credits.
          example: Your appointment is confirmed.
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          description: Optional country calling code including the leading `+` when `phonenumber` is a national number.
          example: '+47'
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          description: Complete international recipient number, or a national number accompanied by `countrycode`.
          example: '12345678'
        date:
          description: Send date in the account timezone, or `now` for immediate delivery. It must be supplied together with `time`.
          oneOf:
            - type: string
              const: now
            - type: string
              format: date
          example: now
        time:
          description: Send time in `HH:MM`, or `now` for immediate delivery. It must be supplied together with `date`.
          oneOf:
            - type: string
              const: now
            - type: string
              pattern: '^([01]\d|2[0-3]):[0-5]\d$'
          example: now
    SmsBatchRequest:
      description: Request body for creating multiple SMS notifications in one call.
      type: object
      required: [batch]
      properties:
        batch:
          type: array
          minItems: 1
          maxItems: 999
          description: Raw-recipient SMS requests executed in one transaction.
          items:
            $ref: '#/components/schemas/SmsBatchItem'
      example:
        batch:
          - message: Your appointment is confirmed.
            countrycode: '+47'
            phonenumber: '12345678'
            date: now
            time: now
          - message: Your order is ready.
            countrycode: '+47'
            phonenumber: '+4798765432'
            date: now
            time: now
    SmsUpdateRequest:
      description: Fields supplied for a planned SMS update; omitted fields retain their current values.
      type: object
      required: [id]
      properties:
        id:
          type: integer
          minimum: 1
          example: 1210966
          description: Planned SMS notification ID to update.
        message:
          type: string
          minLength: 1
          description: Replacement SMS text.
          example: Your updated appointment time is confirmed.
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          description: Replacement country calling code for a raw recipient.
          example: '+47'
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          description: Replacement raw recipient phone number.
          example: '12345678'
        date:
          type: string
          format: date
          description: Replacement scheduled send date.
          example: '2026-05-22'
        time:
          type: string
          pattern: '^([01]\d|2[0-3]):[0-5]\d$'
          description: Replacement scheduled send time.
          example: '09:30'
        contactId:
          type: integer
          minimum: 1
          description: Replacement contact target.
          example: 12345
        contactlistId:
          type: integer
          minimum: 1
          description: Replacement contact-list target.
          example: 67890
        sendername:
          type: string
          description: Replacement sender name subject to account and destination rules.
          example: Intelli

    SmsNotification:
      description: SMS notification returned by the API.
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Notification identifier.
          example: 1210966
        message:
          type: string
          description: SMS message text.
          example: Your appointment is confirmed.
        countrycode:
          type: string
          description: Raw recipient country calling code when applicable.
          example: '+47'
        phonenumber:
          type: string
          description: Raw recipient phone number when applicable.
          example: '+4712345678'
        contactId:
          type: integer
          description: Contact target identifier when applicable.
          example: 12345
        contactlistId:
          type: integer
          description: Contact-list target identifier when applicable.
          example: 67890
        date:
          type: string
          description: Scheduled send date.
          example: '2026-05-21'
        time:
          type: string
          description: Scheduled send time.
          example: '14:24'
        timesendt:
          type: string
          readOnly: true
          description: Legacy send timestamp value returned by the notification service.
          example: '2026-05-21 14:24:00'
        sent:
          type: integer
          readOnly: true
          description: Legacy sent-state value.
          example: 1
        failed:
          type: integer
          readOnly: true
          description: Legacy failed-state value.
          example: 0
        deleted:
          type: integer
          readOnly: true
          description: Legacy deleted-state value.
          example: 0
    SmsCreateSuccess:
      description: Successful creation of one queued or planned SMS notification.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the notification was accepted for creation.
          example: true
        data:
          $ref: '#/components/schemas/SmsNotification'
          description: Created notification. Creation does not confirm handset delivery.
        status_message:
          type: string
          description: Human-readable result message.
          example: SMS was created successfully.
    SmsNotificationSuccess:
      description: Successful lookup, update, or deletion result for one SMS notification.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        data:
          $ref: '#/components/schemas/SmsNotification'
          description: Notification returned by the operation.
        status_message:
          type: string
          description: Human-readable result message.
          example: OK
    SmsBatchSuccess:
      description: Successful execution of a batch request with one result per input item.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the batch transaction completed.
          example: true
        data:
          type: array
          description: Per-item API results in the same order as the request batch.
          items:
            $ref: '#/components/schemas/SmsCreateSuccess'
        status_message:
          type: string
          description: Human-readable batch result message.
          example: Your batch was successfully executed.
    SmsListSuccess:
      description: Legacy paginated notification result. `data` is keyed by notification ID and `pages` is top-level.
      type: object
      required: [success, data, status_message, pages]
      properties:
        success:
          type: boolean
          description: Whether the lookup succeeded.
          example: true
        data:
          description: Object keyed by notification ID, or an empty string when no rows match.
          oneOf:
            - type: object
              additionalProperties:
                $ref: '#/components/schemas/SmsNotification'
            - type: string
              enum: ['']
          example:
            '1210966':
              id: 1210966
              message: Your appointment is confirmed.
              countrycode: '+47'
              phonenumber: '+4712345678'
              timesendt: '2026-05-21 14:24:00'
              sent: 1
              failed: 0
        pages:
          type: integer
          minimum: 0
          description: Total number of pages for the requested page size.
          example: 8
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully fetched notifications.
    SmsReceivedMessage:
      description: Inbound SMS record returned by the legacy notification store.
      type: object
      properties:
        id:
          type: integer
          description: Inbound-message identifier.
          example: 88102
        message:
          type: string
          description: Received message text.
          example: STOPP
        request_sender:
          type: string
          description: Sender phone number as received from the gateway.
          example: '+4712345678'
        request_target:
          type: string
          description: Destination number or inbound service identifier.
          example: '1963'
        trigger_external_path:
          type: string
          description: Legacy callback-routing marker, when configured.
          example: ''
        keyword:
          type: string
          description: Primary matched keyword.
          example: support
        sub_keyword:
          type: string
          description: Secondary matched keyword, when present.
          example: status
        time:
          type: string
          description: Receipt time converted to the account timezone.
          example: '2026-05-21 09:17:32'
    SmsReceivedListSuccess:
      description: Paginated inbound-message result with `pages` at the top level.
      type: object
      required: [success, data, status_message, pages]
      properties:
        success:
          type: boolean
          description: Whether the lookup succeeded.
          example: true
        data:
          description: Inbound messages, or an empty string when no rows match.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/SmsReceivedMessage'
            - type: string
              enum: ['']
        pages:
          type: integer
          minimum: 0
          description: Total number of pages for the requested page size.
          example: 1
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully fetched received notifications.
    SmsStatusRequest:
      description: Request body for fetching status for one or more notification IDs.
      type: object
      anyOf:
        - required: [id_array]
        - required: [id]
        - required: [notification_id]
      properties:
        id_array:
          oneOf:
            - type: array
              minItems: 1
              maxItems: 999
              items:
                type: integer
                minimum: 1
            - type: string
              pattern: '^\s*[0-9]+(\s*,\s*[0-9]+)*\s*$'
          example: [1210966, 1210967]
          description: Preferred format is an array of notification IDs. A comma-separated string is accepted for backward compatibility.
        id:
          type: integer
          minimum: 1
          example: 1210966
          deprecated: true
          description: Deprecated single-ID alias; use `id_array`.
        notification_id:
          type: integer
          minimum: 1
          example: 1210966
          deprecated: true
          description: Deprecated single-ID alias; use `id_array`.
    SmsStatusItem:
      description: Delivery and notification state for one accessible notification.
      type: object
      required: [id, sent, failed, tries, deleted, timesendt, sent_to_operator, confirmed_delivered, method, sender_name, target, countrycode, number_of_sms]
      properties:
        id:
          type: integer
          description: Notification identifier.
          example: 1210966
        sent:
          type: integer
          description: Legacy sent-state value.
          example: 1
        failed:
          type: integer
          description: Legacy failed-state value.
          example: 0
        tries:
          type: integer
          description: Number of recorded delivery attempts.
          example: 1
        deleted:
          type: integer
          description: Legacy deleted-state value.
          example: 0
        timesendt:
          type: string
          description: Send timestamp in the account timezone, or an empty string when unavailable.
          example: '2026-05-21 14:24:00'
        sent_to_operator:
          type: integer
          description: Whether the message was accepted for operator delivery.
          example: 1
        confirmed_delivered:
          type: integer
          description: Whether a successful downstream delivery receipt was recorded.
          example: 1
        method:
          type: string
          description: Notification channel recorded for the requested ID.
          enum: [sms, email]
          example: sms
        sender_name:
          type: string
          description: Sender identity associated with the notification.
          example: Intelli
        target:
          type: string
          example: '+4712345678'
          description: Single-recipient phone number or email address. Empty for contact-list and multi-recipient campaigns.
        countrycode:
          type: string
          example: '+47'
          description: SMS country code for a single-recipient SMS. Empty for email and multi-recipient campaigns.
        number_of_sms:
          type: integer
          example: 1
          description: SMS parts per recipient for SMS. Always 0 for email notifications.
    SmsStatusSuccess:
      description: Successful multi-ID notification-status lookup.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the status lookup succeeded.
          example: true
        data:
          type: object
          description: Object keyed by notification ID.
          additionalProperties:
            $ref: '#/components/schemas/SmsStatusItem'
          example:
            '1210966':
              id: 1210966
              sent: 1
              failed: 0
              tries: 1
              deleted: 0
              timesendt: '2026-05-21 14:24:00'
              sent_to_operator: 1
              confirmed_delivered: 1
              method: sms
              sender_name: Intelli
              target: '+4712345678'
              countrycode: '+47'
              number_of_sms: 1
        status_message:
          type: string
          description: Human-readable result message.
          example: OK

    ContactInput:
      description: Editable contact fields. Omitted optional fields are stored as empty strings on creation.
      type: object
      properties:
        name:
          type: string
          description: Contact name.
          example: Kari Nordmann
        company:
          type: string
          description: Company or organization name.
          example: Example Company AS
        dob:
          type: string
          format: date
          description: Date of birth, when supplied.
          example: '1985-04-12'
        sex:
          type: string
          enum: [male, female, '']
          description: Legacy normalized value. The runtime stores `male`, `female`, or an empty string.
          example: female
        zipcode:
          type: string
          description: Postal code.
          example: '1613'
        country:
          type: string
          description: Country name.
          example: Norway
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          description: Phone-number country calling code including `+`.
          example: '+47'
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          description: Contact phone number.
          example: '+4712345678'
        email:
          type: string
          format: email
          description: Contact email address.
          example: kari@example.com
        facebook:
          type: string
          description: Legacy Facebook reference.
          example: ''
        twitter:
          type: string
          description: Legacy Twitter/X reference.
          example: ''
        param1:
          type: string
          description: Customer-defined contact field 1.
          example: Customer segment A
        param2:
          type: string
          description: Customer-defined contact field 2.
          example: Store Oslo
        param3:
          type: string
          description: Customer-defined contact field 3.
          example: Newsletter opt-in
    Contact:
      description: Contact record returned by the API.
      allOf:
        - $ref: '#/components/schemas/ContactInput'
        - type: object
          properties:
            id:
              type: integer
              readOnly: true
              description: Contact identifier.
              example: 12345
            time_added:
              type: string
              readOnly: true
              description: Legacy contact creation timestamp.
              example: '2026-05-21 09:12:00'
    ContactRequest:
      description: Request body for creating a contact.
      allOf:
        - $ref: '#/components/schemas/ContactInput'
    ContactUpdateRequest:
      description: Request body for updating a contact; omitted fields retain their existing values.
      allOf:
        - $ref: '#/components/schemas/ContactInput'
        - type: object
          required: [id]
          properties:
            id:
              type: integer
              minimum: 1
              description: Contact ID to update.
              example: 12345
    ContactMutationSuccess:
      description: Successful contact creation or update.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the mutation succeeded.
          example: true
        data:
          $ref: '#/components/schemas/Contact'
          description: Created or updated contact.
        status_message:
          type: string
          description: Human-readable result message.
          example: The contact was successfully created.
    ContactLookupSuccess:
      description: Single-contact lookup. The legacy runtime returns the match in a one-item array.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the lookup succeeded.
          example: true
        data:
          type: array
          description: One-item array containing the requested contact.
          minItems: 1
          maxItems: 1
          items:
            $ref: '#/components/schemas/Contact'
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully fetched contact(s).
    ContactDeleteSuccess:
      description: Successful contact deletion.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the delete succeeded.
          example: true
        data:
          type: object
          description: Identifier of the deleted contact.
          required: [id]
          properties:
            id:
              type: integer
              description: Deleted contact identifier.
              example: 12345
        status_message:
          type: string
          description: Human-readable result message.
          example: The contact was successfully deleted.
    ContactSearchSuccess:
      description: Paginated contact search with the page count at top level.
      type: object
      required: [success, data, status_message, pages]
      properties:
        success:
          type: boolean
          description: Whether the search succeeded.
          example: true
        data:
          type: array
          description: Contacts on the requested page.
          items:
            $ref: '#/components/schemas/Contact'
        pages:
          type: integer
          minimum: 0
          description: Total number of pages for the requested page size.
          example: 13
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully fetched contact(s).

    ContactListRequest:
      description: Request body for creating a contact list.
      type: object
      required: [name]
      properties:
        name:
          type: string
          minLength: 1
          example: Customers Norway
          description: Contact list name.
    ContactListUpdateRequest:
      description: Request body for updating a contact list.
      type: object
      required: [name]
      anyOf:
        - required: [id]
        - required: [contactlist_id]
        - required: [contactlistId]
        - required: [contactListId]
      properties:
        name:
          type: string
          minLength: 1
          description: New contact-list name.
          example: Customers Oslo
        id:
          type: integer
          minimum: 1
          description: Preferred contact-list ID property.
          example: 67890
        contactlist_id:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `id`.
        contactlistId:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `id`.
        contactListId:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `id`.
    ContactList:
      description: Contact list metadata.
      type: object
      properties:
        id:
          type: integer
          readOnly: true
          description: Contact-list identifier.
          example: 67890
        contactlist_name:
          type: string
          description: Validated contact-list name returned by create and update operations.
          example: Customers Norway
        list_name:
          type: string
          description: Stored contact-list name.
          example: Customers Norway
        contacts:
          type: integer
          readOnly: true
          description: Number of contacts, returned by the single-list lookup.
          example: 250
        num_contacts:
          type: integer
          readOnly: true
          description: Number of contacts, returned by list searches.
          example: 250
        read_only:
          type: integer
          readOnly: true
          description: Legacy read-only flag returned by the single-list lookup.
          example: 0
    ContactListSingleSuccess:
      description: Contact-list create, update, lookup, or delete result.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        data:
          $ref: '#/components/schemas/ContactList'
          description: Contact-list record returned by the operation.
        status_message:
          type: string
          description: Human-readable result message.
          example: Your contactlist was successfully fetched.
    ContactListSearchSuccess:
      description: Paginated contact-list search with `pages` at top level.
      type: object
      required: [success, data, status_message, pages]
      properties:
        success:
          type: boolean
          description: Whether the search succeeded.
          example: true
        data:
          type: array
          description: Contact lists on the requested page.
          items:
            $ref: '#/components/schemas/ContactList'
        pages:
          type: integer
          minimum: 0
          description: Total number of pages for the requested page size.
          example: 1
        status_message:
          type: string
          description: Human-readable result message; it may be empty for this legacy list operation.
          example: ''
    ContactListMembershipSuccess:
      description: Paginated contact-list members with `pages` at top level.
      type: object
      required: [success, data, status_message, pages]
      properties:
        success:
          type: boolean
          description: Whether the lookup succeeded.
          example: true
        data:
          type: array
          description: Contacts on the requested page.
          items:
            $ref: '#/components/schemas/Contact'
        pages:
          type: integer
          minimum: 0
          description: Total number of pages for the requested page size.
          example: 13
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully fetched contacts in your contactlist.
    ContactListMembershipChangeRequest:
      description: Request body for adding an existing contact to a contact list.
      type: object
      required: [contactId]
      anyOf:
        - required: [contactListId]
        - required: [contactlist_id]
        - required: [contactlistId]
        - required: [id]
      properties:
        contactListId:
          type: integer
          minimum: 1
          example: 67890
          description: Preferred contact-list ID property for membership operations.
        contactlist_id:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `contactListId`.
        contactlistId:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `contactListId`.
        id:
          type: integer
          minimum: 1
          deprecated: true
          description: Deprecated ID alias; use `contactListId`.
        contactId:
          type: integer
          minimum: 1
          example: 12345
          description: Contact ID to add to the list.
    ContactListMembershipChangeSuccess:
      description: Successful addition or removal of a contact-list membership.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the membership operation succeeded.
          example: true
        data:
          type: object
          description: Contact-list and contact identifiers affected by the operation.
          required: [contactlist_id, contact_id]
          properties:
            id:
              type: integer
              readOnly: true
              description: Membership row ID returned when a contact is added.
              example: 99102
            contactlist_id:
              type: integer
              description: Contact-list identifier.
              example: 67890
            contact_id:
              type: integer
              description: Contact identifier.
              example: 12345
        status_message:
          type: string
          description: Human-readable result message.
          example: The contact was added to the contactlist.

    ShortUrlRequest:
      description: Request body for creating a parent short URL.
      type: object
      required: [url]
      properties:
        url:
          type: string
          format: uri
          example: https://www.intellipush.com/?utm_source=customer_base&utm_medium=sms&utm_campaign=summer_sale
          description: Long URL to shorten.
    ShortUrlChildRequest:
      description: Request body for creating a recipient-specific child short URL.
      type: object
      required: [id, target]
      properties:
        id:
          type: integer
          minimum: 1
          example: 24680
          description: Parent short URL ID.
        target:
          type: object
          description: Recipient metadata for a child URL. Supply exactly one contact, email address, or phone-number target.
          oneOf:
            - required: [contact_id]
            - required: [email]
            - required: [phonenumber]
          properties:
            contact_id:
              type: integer
              minimum: 1
              description: Existing contact ID used as the child URL target.
              example: 12345
            email:
              type: string
              format: email
              description: Recipient email target.
              example: kari@example.com
            countrycode:
              type: string
              pattern: '^\+[0-9]{1,4}$'
              example: '+47'
              description: Optional country calling code when `phonenumber` is a national number.
            phonenumber:
              type: string
              pattern: '^\+?[0-9]{6,15}$'
              example: '12345678'
              description: Complete international recipient number, or a national number accompanied by `countrycode`.
    ShortUrl:
      description: Newly created parent or child short URL.
      type: object
      required: [id, long_url, short_url, created]
      properties:
        id:
          type: integer
          readOnly: true
          description: Short URL identifier.
          example: 24680
        long_url:
          type: string
          format: uri
          description: Destination URL.
          example: https://www.intellipush.com/?utm_source=customer_base&utm_medium=sms&utm_campaign=summer_sale
        short_url:
          type: string
          format: uri
          readOnly: true
          description: Generated Intellipush short URL.
          example: https://1p.nu/9C3c1S
        created:
          type: string
          readOnly: true
          description: Creation timestamp in the account timezone.
          example: '2026-05-21 09:12:00'
        target_countrycode:
          type: string
          description: Child URL recipient country code, when applicable.
          example: '+47'
        target_phonenumber:
          type: string
          description: Child URL recipient phone number, when applicable.
          example: '+4712345678'
        target_email:
          type: string
          description: Child URL recipient email, when applicable.
          example: ''
        target_contact_id:
          type: integer
          description: Child URL recipient contact ID, when applicable.
          example: 12345
    ShortUrlSuccess:
      description: Successful parent or recipient-specific short-URL creation.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether URL creation succeeded.
          example: true
        data:
          $ref: '#/components/schemas/ShortUrl'
          description: Created short URL and destination metadata.
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully created short url.
    ShortUrlDetails:
      description: Stored short URL and aggregate visit information.
      type: object
      properties:
        id:
          type: integer
          description: Short URL identifier.
          example: 24680
        long_url:
          type: string
          format: uri
          description: Destination URL.
          example: https://www.intellipush.com/?utm_source=customer_base&utm_medium=sms&utm_campaign=summer_sale
        short_url:
          type: string
          format: uri
          description: Generated Intellipush short URL.
          example: https://1p.nu/9C3c1S
        parent_url_id:
          type: integer
          description: Parent URL ID for a child URL, or 0 for a parent URL.
          example: 0
        created:
          type: string
          description: Creation timestamp.
          example: '2026-05-21 09:12:00'
        visited:
          type: integer
          description: Legacy boolean visit flag.
          example: 1
        visits:
          type: integer
          description: Recorded visit count.
          example: 42
        unique_visits:
          type: integer
          description: Recorded unique visit count.
          example: 37
        child_urls:
          type: integer
          description: Number of generated child URLs.
          example: 12
        last_visited_time:
          type: string
          description: Last recorded visit timestamp, or the legacy value `0` when never visited.
          example: '2026-05-21 10:18:00'
        target_countrycode:
          type: string
          description: Child URL recipient country code.
          example: '+47'
        target_phonenumber:
          type: string
          description: Child URL recipient phone number.
          example: '+4712345678'
        target_email:
          type: string
          description: Child URL recipient email.
          example: ''
        target_contact_id:
          type: integer
          description: Child URL recipient contact ID.
          example: 12345
        sent:
          description: Legacy sent-state value exposed by the REST adapter.
          oneOf:
            - type: integer
            - type: string
          example: 1
    ShortUrlDetailsSuccess:
      description: Successful short-URL details lookup.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the lookup succeeded.
          example: true
        data:
          $ref: '#/components/schemas/ShortUrlDetails'
          description: Stored URL and aggregate visit information.
        status_message:
          type: string
          description: Human-readable result message.
          example: Successfully got short url details.

    TwoFactorGenerateRequest:
      description: Request body for generating and sending a two-factor code.
      type: object
      required: [countrycode, phonenumber]
      properties:
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          example: '+47'
          description: Recipient country code.
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          example: '12345678'
          description: Recipient phone number. When countrycode is +47, the +47 prefix can be omitted.
        message_pre_code:
          type: string
          description: Text placed before the generated five-digit code. Keep the message concise because SMS segmentation consumes credits.
          example: 'This is your one-time password: '
        message_post_code:
          type: string
          description: Text placed after the generated code.
          example: ' Do not share it with anyone.'
        message_p1:
          type: string
          deprecated: true
          description: Deprecated alias for `message_pre_code`. When non-empty, this legacy field takes precedence.
          example: 'This is your one-time password: '
        message_p2:
          type: string
          deprecated: true
          description: Deprecated alias for `message_post_code`. When non-empty, this legacy field takes precedence.
          example: ' Do not share it with anyone.'
    TwoFactorGeneratedNotification:
      description: |
        Raw notification object returned when a new code is generated and its
        SMS notification is created. This legacy response is not wrapped in
        the standard `success`, `data`, and `status_message` envelope. Extra
        notification attributes can be present.
      type: object
      required: [id]
      additionalProperties: true
      properties:
        id:
          type: integer
          description: Created SMS notification identifier.
          example: 1210966
        single_target_countrycode:
          type: string
          description: Recipient country calling code stored on the notification.
          example: '+47'
        single_target:
          type: string
          description: Recipient phone number stored on the notification.
          example: '+4712345678'
        text_message:
          type: string
          description: Redacted message field. The REST v2 controller clears the generated code before returning the object.
          example: ''
        method:
          type: string
          description: Notification channel used for code delivery.
          enum: [sms]
          example: sms
        when:
          type: string
          description: Planned send time converted to the account timezone.
          example: '2026-05-21 09:17:00'
    TwoFactorExistingCodeResult:
      description: Result returned when an unused code already exists for the supplied number.
      type: object
      required: [hasCode]
      properties:
        hasCode:
          type: boolean
          const: true
          description: Indicates that another code was not generated or sent.
          example: true
    TwoFactorExistingCodeSuccess:
      description: Standard envelope returned when an unused code already exists.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the existing-code lookup completed successfully.
          example: true
        data:
          $ref: '#/components/schemas/TwoFactorExistingCodeResult'
          description: Existing-code indicator; no SMS is sent in this response variant.
        status_message:
          type: string
          description: Human-readable legacy result message.
          example: A code is already sendt.
    TwoFactorGenerateSuccess:
      description: One of the two successful legacy response shapes returned by code generation.
      oneOf:
        - $ref: '#/components/schemas/TwoFactorGeneratedNotification'
        - $ref: '#/components/schemas/TwoFactorExistingCodeSuccess'
    TwoFactorValidateRequest:
      description: Request body for validating a two-factor code.
      type: object
      required: [countrycode, phonenumber, code]
      properties:
        countrycode:
          type: string
          pattern: '^\+[0-9]{1,4}$'
          example: '+47'
          description: Recipient country code.
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          example: '12345678'
          description: Recipient phone number. When countrycode is +47, the +47 prefix can be omitted.
        code:
          type: string
          minLength: 1
          pattern: '^[0-9]+$'
          description: Numeric code supplied by the recipient. Newly generated codes contain five digits.
          example: '12345'
    TwoFactorValidateResult:
      description: Access decision returned after code validation.
      type: object
      required: [access]
      properties:
        access:
          type: boolean
          description: True only when the supplied code matched and was marked as successfully used.
          example: true
    TwoFactorValidateSuccess:
      description: Successful code validation response.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether validation completed without an application error.
          example: true
        data:
          $ref: '#/components/schemas/TwoFactorValidateResult'
          description: Access decision for the supplied code.
        status_message:
          type: string
          description: Human-readable legacy result message.
          example: 'Success: Correct code entered.'

    AdditiveApiError:
      description: Error envelope used by additive REST operations that expose stable string error codes.
      type: object
      required: [success, errorcode, status_message]
      properties:
        success:
          type: boolean
          enum: [false]
          description: Always false for this error response.
          example: false
        errorcode:
          description: Stable string error code for new operations, or a retained integer code where legacy validation is reused.
          oneOf:
            - type: string
              minLength: 1
            - type: integer
          example: invalid_date_range
        status_message:
          type: string
          description: Human-readable diagnostic text that is not a stable programmatic value.
          example: Invalid request.

    ApiFeatureAvailability:
      description: Additive REST capabilities currently enabled for the authenticated account.
      type: object
      required: [sms_quote, sms_senders, message_statistics, idempotency, event_feed, webhooks]
      properties:
        sms_quote:
          type: boolean
          description: Whether the read-only SMS quote operation is available.
          example: true
        sms_senders:
          type: boolean
          description: Whether SMS sender discovery is available.
          example: true
        message_statistics:
          type: boolean
          description: Whether channel-aware message statistics are available.
          example: true
        idempotency:
          type: boolean
          description: Whether optional SMS creation idempotency is enabled for this account.
          example: false
        event_feed:
          type: boolean
          description: Whether the channel-neutral event feed is enabled for this account.
          example: false
        webhooks:
          type: boolean
          description: Whether signed customer webhook subscriptions are enabled for this account.
          example: false
    ApiCapabilityLimits:
      description: Current account-specific integration limits advertised by REST v2.
      type: object
      required: [sms_batch_recipients]
      properties:
        sms_batch_recipients:
          type: integer
          minimum: 1
          maximum: 999
          description: Maximum recipient items accepted by one SMS batch operation.
          example: 999
    CapabilitiesData:
      description: Discoverable channels, features and limits for the authenticated account.
      type: object
      required: [account_id, channels, permitted_scopes, features, limits, statistics_channels]
      properties:
        account_id:
          type: string
          pattern: '^[0-9]+$'
          description: Stable effective customer-account identifier.
          example: '42'
        channels:
          type: array
          description: Messaging channels currently available to this account.
          items:
            type: string
            enum: [sms, email, whatsapp]
          example: [sms]
        permitted_scopes:
          type: array
          description: OAuth permissions associated with the current client; legacy clients report legacy_full_access.
          items:
            type: string
          example: [legacy_full_access]
        features:
          $ref: '#/components/schemas/ApiFeatureAvailability'
          description: Account-specific availability of additive REST features.
        limits:
          $ref: '#/components/schemas/ApiCapabilityLimits'
          description: Operational request limits relevant to integrations.
        statistics_channels:
          type: array
          description: Channels currently represented by the message-statistics operation.
          items:
            type: string
            enum: [sms, email, whatsapp]
          example: [sms]
    CapabilitiesSuccess:
      description: Successful account-capability discovery response.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether capability discovery completed successfully.
          example: true
        data:
          $ref: '#/components/schemas/CapabilitiesData'
          description: Capabilities and limits for the authenticated account.
        status_message:
          type: string
          description: Human-readable result message.
          example: API capabilities fetched.

    SmsSender:
      description: One sender identity available to the authenticated account.
      type: object
      required: [sender, type, is_default]
      properties:
        sender:
          type: string
          minLength: 1
          description: Numeric or alphanumeric sender value presented by the account configuration.
          example: Intelli
        type:
          type: string
          enum: [numeric, alphanumeric]
          description: Sender format classification.
          example: alphanumeric
        is_default:
          type: boolean
          description: Whether this is the account's default sender.
          example: true
    SmsSendersData:
      description: SMS sender discovery data and destination-availability guidance.
      type: object
      required: [senders, custom_sender_supported, availability_note]
      properties:
        senders:
          type: array
          description: Sender identities available to this account.
          items:
            $ref: '#/components/schemas/SmsSender'
        custom_sender_supported:
          type: boolean
          description: Whether the account can use a supported custom sender through existing account configuration.
          example: true
        availability_note:
          type: string
          description: Human-readable warning that destination and account restrictions can affect sender availability.
          example: Sender availability depends on account configuration and destination rules.
    SmsSendersSuccess:
      description: Successful SMS sender discovery response.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether sender discovery completed successfully.
          example: true
        data:
          $ref: '#/components/schemas/SmsSendersData'
          description: Available senders and usage guidance.
        status_message:
          type: string
          description: Human-readable result message.
          example: Available SMS sender information fetched.

    SmsQuoteSingleRequest:
      description: One raw-phone SMS request to validate and estimate without sending.
      type: object
      required: [message, countrycode, phonenumber]
      additionalProperties: false
      properties:
        message:
          type: string
          minLength: 1
          description: SMS text to normalize, segment and estimate.
          example: Your appointment is confirmed.
        countrycode:
          type: string
          pattern: '^(?:\+|00)?[0-9]{1,4}$'
          description: Recipient country calling code, such as +47 or 0047.
          example: '+47'
        phonenumber:
          type: string
          pattern: '^\+?[0-9]{6,15}$'
          description: Recipient phone number. A complete international number can be supplied without a separate prefix in the number field.
          example: '90000000'
        date:
          type: string
          description: Delivery date as YYYY-MM-DD, or now for immediate delivery. Omission on a single quote means immediate delivery.
          example: now
        time:
          type: string
          description: Delivery time as 24-hour HH:MM, or now for immediate delivery. Omission on a single quote means immediate delivery.
          example: now
    SmsQuoteBatchItem:
      description: One item in a batch quote; date and time are required to mirror the existing batch-send contract.
      allOf:
        - $ref: '#/components/schemas/SmsQuoteSingleRequest'
        - type: object
          required: [date, time]
    SmsQuoteBatchRequest:
      description: Batch quote request containing between one and 999 independent raw-phone SMS items.
      type: object
      required: [batch]
      additionalProperties: false
      properties:
        batch:
          type: array
          minItems: 1
          maxItems: 999
          description: SMS items to validate and estimate in the submitted order.
          items:
            $ref: '#/components/schemas/SmsQuoteBatchItem'
    SmsQuoteRequest:
      description: Either one raw-phone SMS quote request or a batch quote request.
      oneOf:
        - $ref: '#/components/schemas/SmsQuoteSingleRequest'
        - $ref: '#/components/schemas/SmsQuoteBatchRequest'
    EstimatedCharge:
      description: Estimated account charge for one quote item or the successful items in the complete request.
      type: object
      required: [amount, unit, currency]
      properties:
        amount:
          type: string
          pattern: '^[0-9]+(?:\.[0-9]+)?$'
          description: Locale-independent decimal amount; prepaid values are whole centicredits and money values use three decimal places.
          example: '100'
        unit:
          type: string
          enum: [centicredits, money]
          description: Unit represented by amount.
          example: centicredits
        currency:
          type: [string, 'null']
          pattern: '^[A-Z]{3}$'
          description: ISO 4217 currency for money estimates, or null for centicredits.
          example: null
    SmsQuoteSuccessItem:
      description: Successfully validated and priced item in an SMS quote.
      type: object
      required: [index, success, normalized_message, input_encoding, encoding, character_count, input_segments, segments, billing_segments, recipients, countrycode, phonenumber, sender, billing_model, estimated_charge]
      properties:
        index:
          type: integer
          minimum: 0
          description: Zero-based item position in the submitted request.
          example: 0
        success:
          type: boolean
          enum: [true]
          description: Always true for a successfully quoted item.
          example: true
        normalized_message:
          type: string
          description: Message after applying the same character normalization used by SMS creation.
          example: Your appointment is confirmed.
        input_encoding:
          type: string
          description: SMS encoding classification before platform normalization.
          example: GSM-7
        encoding:
          type: string
          description: SMS encoding classification after platform normalization.
          example: GSM-7
        character_count:
          type: integer
          minimum: 0
          description: Character count of the normalized message.
          example: 30
        input_segments:
          type: integer
          minimum: 1
          description: SMS segment count before platform normalization.
          example: 1
        segments:
          type: integer
          minimum: 1
          description: SMS segment count after platform normalization.
          example: 1
        billing_segments:
          type: integer
          minimum: 1
          description: Segment count the existing sending queue would charge.
          example: 1
        recipients:
          type: integer
          enum: [1]
          description: Recipient count represented by this quote item.
          example: 1
        countrycode:
          type: string
          description: Normalized recipient country calling code used by the sending path.
          example: '0047'
        phonenumber:
          type: string
          description: Normalized recipient phone number used by the sending path.
          example: '90000000'
        sender:
          type: string
          description: Sender selected by existing account and destination rules.
          example: Intelli
        billing_model:
          type: string
          enum: [prepaid, invoice]
          description: Account billing model used for this estimate.
          example: prepaid
        estimated_charge:
          $ref: '#/components/schemas/EstimatedCharge'
          description: Estimated charge for this item based on its billing segments.
    SmsQuoteFailureItem:
      description: Item-level validation or pricing failure returned without sending anything.
      type: object
      required: [index, success, errorcode, status_message]
      properties:
        index:
          type: integer
          minimum: 0
          description: Zero-based item position in the submitted request.
          example: 0
        success:
          type: boolean
          enum: [false]
          description: Always false for a failed quote item.
          example: false
        errorcode:
          description: Stable quote error code or a retained integer from existing SMS validation.
          oneOf:
            - type: string
              minLength: 1
            - type: integer
          example: quote_price_unavailable
        status_message:
          type: string
          description: Human-readable item failure message.
          example: The SMS price is unavailable for this destination.
    SmsQuoteItem:
      description: One successful or failed quote item in its original request position.
      oneOf:
        - $ref: '#/components/schemas/SmsQuoteSuccessItem'
        - $ref: '#/components/schemas/SmsQuoteFailureItem'
    SmsQuoteData:
      description: Item results and totals for one SMS quote request.
      type: object
      required: [items, recipients, segments, billing_model, estimated_charge]
      properties:
        items:
          type: array
          minItems: 1
          description: Successful and failed item results in submitted order.
          items:
            $ref: '#/components/schemas/SmsQuoteItem'
        recipients:
          type: integer
          minimum: 0
          description: Number of successfully quoted recipients.
          example: 1
        segments:
          type: integer
          minimum: 0
          description: Sum of billing segments across successfully quoted items.
          example: 1
        billing_model:
          type: string
          enum: [prepaid, invoice]
          description: Account billing model used for all successful estimates.
          example: prepaid
        estimated_charge:
          description: Sum of successful item estimates, or null when no item could be quoted.
          oneOf:
            - $ref: '#/components/schemas/EstimatedCharge'
            - type: 'null'
    SmsQuoteSuccess:
      description: Quote response containing at least one successful item.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the quote request produced at least one successful estimate.
          example: true
        data:
          $ref: '#/components/schemas/SmsQuoteData'
          description: Per-item quote results and successful-item totals.
        status_message:
          type: string
          description: Human-readable result message.
          example: SMS quote calculated without creating notifications.
    SmsQuoteError:
      description: Quote failure envelope that can retain item-level diagnostics without sending anything.
      type: object
      required: [success, errorcode, status_message]
      properties:
        success:
          type: boolean
          enum: [false]
          description: Always false when no quote can be returned.
          example: false
        errorcode:
          description: Stable quote failure code.
          oneOf:
            - type: string
              minLength: 1
            - type: integer
          example: quote_validation_failed
        status_message:
          type: string
          description: Human-readable request failure message.
          example: No SMS quote item could be calculated.
        data:
          $ref: '#/components/schemas/SmsQuoteData'
          description: Optional item-level diagnostics and zero successful totals.

    MessageConsumption:
      description: Consumption quantity expressed in a channel-specific unit.
      type: object
      required: [unit, quantity]
      properties:
        unit:
          type: string
          enum: [sms_segments]
          description: Billable consumption unit for the SMS channel.
          example: sms_segments
        quantity:
          type: integer
          minimum: 0
          description: Number of billable SMS segments.
          example: 58
    MessageStatisticsCountry:
      description: SMS recipient and segment usage for one destination country.
      type: object
      required: [country_code, recipient_messages, consumption]
      properties:
        country_code:
          type: string
          pattern: '^(?:[A-Z]{2}|XX)$'
          description: ISO alpha-2 destination code, or XX when no valid code is available.
          example: 'NO'
        recipient_messages:
          type: integer
          minimum: 0
          description: Number of archived recipient message records for this country.
          example: 50
        consumption:
          $ref: '#/components/schemas/MessageConsumption'
          description: Billable SMS segments for this country.
    MessageStatisticsTotals:
      description: SMS usage totals for one day or the complete requested period.
      type: object
      required: [recipient_messages, consumption, countries]
      properties:
        recipient_messages:
          type: integer
          minimum: 0
          description: Total archived recipient message records in this scope.
          example: 52
        consumption:
          $ref: '#/components/schemas/MessageConsumption'
          description: Total billable SMS segments in this scope.
        countries:
          type: array
          description: Country totals sorted by uppercase country code.
          items:
            $ref: '#/components/schemas/MessageStatisticsCountry'
    MessageStatisticsDay:
      description: Zero-filled SMS usage for one requested UTC calendar date.
      type: object
      required: [date, recipient_messages, consumption, countries]
      properties:
        date:
          type: string
          format: date
          description: UTC calendar date represented by this row.
          example: '2026-08-01'
        recipient_messages:
          type: integer
          minimum: 0
          description: Total archived recipient message records on this date.
          example: 50
        consumption:
          $ref: '#/components/schemas/MessageConsumption'
          description: Total billable SMS segments on this date.
        countries:
          type: array
          description: Country usage rows sorted by uppercase country code.
          items:
            $ref: '#/components/schemas/MessageStatisticsCountry'
    SmsMessageStatistics:
      description: SMS period totals and chronological zero-filled daily usage.
      type: object
      required: [totals, daily]
      properties:
        totals:
          $ref: '#/components/schemas/MessageStatisticsTotals'
          description: SMS recipient and consumption totals for the complete period.
        daily:
          type: array
          description: One row for every requested date in chronological order.
          items:
            $ref: '#/components/schemas/MessageStatisticsDay'
    MessageStatisticsChannels:
      description: Channel-specific statistics container; future channel siblings can be added without changing SMS data.
      type: object
      required: [sms]
      properties:
        sms:
          $ref: '#/components/schemas/SmsMessageStatistics'
          description: SMS recipient-message and billable-segment statistics.
      additionalProperties: true
    MessageStatisticsData:
      description: Inclusive date range and channel-specific message usage.
      type: object
      required: [from_date, to_date, channels]
      properties:
        from_date:
          type: string
          format: date
          description: First UTC date in the inclusive statistics period.
          example: '2026-08-01'
        to_date:
          type: string
          format: date
          description: Last UTC date in the inclusive statistics period.
          example: '2026-08-26'
        channels:
          $ref: '#/components/schemas/MessageStatisticsChannels'
          description: Statistics grouped by messaging channel.
    MessageStatisticsSuccess:
      description: Successful channel-aware message-statistics response.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the statistics lookup completed successfully.
          example: true
        data:
          $ref: '#/components/schemas/MessageStatisticsData'
          description: Inclusive date range and channel-specific statistics.
        status_message:
          type: string
          description: Human-readable result message.
          example: Message statistics fetched.
    MessageEventNormalizedStatus:
      description: Channel-neutral lifecycle state derived from the stored SMS delivery status.
      type: string
      enum: [accepted, scheduled, queued, sent_to_provider, delivered, failed, cancelled, expired, unknown]
      example: delivered
    SmsReceivedEventData:
      description: Incoming SMS data owned by the authenticated account.
      type: object
      required: [incoming_id, from, to, keyword, second_keyword, sub_keyword, message]
      properties:
        incoming_id:
          type: string
          pattern: '^[0-9]+$'
          description: Stable identifier of the stored incoming message.
          example: '206799'
        from:
          type: string
          description: Sender address or phone number reported for the incoming SMS.
          example: '+4799999999'
        to:
          type: string
          description: Intellipush destination number that received the SMS.
          example: '1963'
        keyword:
          type: string
          description: Primary keyword parsed from the incoming SMS, or an empty string.
          example: EXAMPLE
        second_keyword:
          type: string
          description: Secondary keyword parsed from the incoming SMS, or an empty string.
          example: ''
        sub_keyword:
          type: string
          description: Additional parsed keyword value, or an empty string.
          example: ''
        message:
          type: string
          description: Complete incoming message text. Treat this customer content as personal data.
          example: Example incoming message
    SmsStatusChangedEventData:
      description: Normalized SMS delivery-state change for a message owned by the authenticated account.
      type: object
      required: [notification_id, recipient, status]
      properties:
        notification_id:
          type: string
          minLength: 1
          description: Existing Intellipush notification identifier used for status correlation.
          example: example-message-42
        recipient:
          type: string
          description: Normalized recipient representation associated with the delivery update.
          example: '+4799999999'
        status:
          $ref: '#/components/schemas/MessageEventNormalizedStatus'
          description: Normalized lifecycle state suitable for programmatic handling.
    MessageEvent:
      description: One retained channel-neutral event in the authenticated account's feed.
      type: object
      required: [event_id, type, channel, occurred_at, data, original_provider_status]
      properties:
        event_id:
          type: string
          pattern: '^evt_[0-9]+$'
          description: Stable event identifier used for ordering and consumer deduplication.
          example: evt_1251
        type:
          type: string
          enum: [sms.received, sms.status_changed]
          description: Event type. Consumers should tolerate additional documented types in future versions.
          example: sms.status_changed
        channel:
          type: string
          enum: [sms]
          description: Messaging channel that produced the event.
          example: sms
        occurred_at:
          type: string
          format: date-time
          description: UTC time associated with the durable source record.
          example: '2026-09-02T08:15:12Z'
        data:
          description: Type-specific event data; incoming events can contain message text and phone numbers.
          oneOf:
            - $ref: '#/components/schemas/SmsReceivedEventData'
            - $ref: '#/components/schemas/SmsStatusChangedEventData'
        original_provider_status:
          type: string
          description: Original provider status retained for diagnostics, or an empty string when not applicable.
          example: '2000'
    MessageEventsData:
      description: Ordered event page and cursor for the next request.
      type: object
      required: [channel, events, next_cursor]
      properties:
        channel:
          type: string
          enum: [sms]
          description: Channel selected for this event feed.
          example: sms
        events:
          type: array
          description: Events after the supplied cursor, ordered by increasing event ID.
          maxItems: 500
          items:
            $ref: '#/components/schemas/MessageEvent'
        next_cursor:
          type: string
          pattern: '^evt_[0-9]+$'
          description: Cursor to persist and supply after successfully processing this page.
          example: evt_1251
    MessageEventsSuccess:
      description: Successful tenant-scoped message-event page.
      type: object
      required: [success, data, status_message]
      properties:
        success:
          type: boolean
          description: Whether the event lookup completed successfully.
          example: true
        data:
          $ref: '#/components/schemas/MessageEventsData'
          description: Event page and continuation cursor.
        status_message:
          type: string
          description: Human-readable result message.
          example: Message events fetched.
  securitySchemes:
    token_client_basic:
      description: Preferred token-endpoint client authentication using API ID as username and API Secret as password.
      type: http
      scheme: basic
    oauth2_client_credentials:
      description: OAuth 2.0 client credentials for confidential server-to-server integrations. Authorization is not persisted by this documentation UI.
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.intellipush.com/restv2/token
          scopes: {}




