











openapi: 3.0.3
info:
  title: TxTRIA API
  description: |
    
    ![Delivery Flow](https://txtria.net/console_assets/images/logoSSA.png)
    
    # Welcome to the TxTRIA API

    The TxTRIA API offers programmatic control over phone number provisioning, message transmission, subscriber lifecycle management, and real-time reporting through a secure and structured interface.


    ## Authentication
    Most requests require post using your sys_id and auth_token.

    Example:
    ```bash
    curl -k -X POST https://txtria.net/api/COMMAND -d "this1=that1&this2=that2&sys_id=ACfc98e7b0aae031b9fa&auth_token=c74eac89884a126a2cca"
    ```

    ## API Modules Overview

    - Accounts
      - Get Account Info
      - Set SMS Delivery URL for inbound MO messages
      - Modify DCA representative email for campaign audit reporting

    - Messaging
      - Send SMS
      - Send MMS
      - Send Shortcode SMS/MMS
      - Get SMS History
      - Get Phone History
      - Block / Unblock Phone
      - Get Messaging History
      - DLR Status Lookup
      - Send Pool SMS
      - List Pools
    
    - Phone Number
      - List Tollfree Numbers
      - Buy Tollfree Number
      - List States
      - List Ratecenters
      - List Available Local Numbers
      - Search Available Local Numbers
      - Buy Local Number
      - Get Number TID
      - Release Number
      - Restore Number
      - Owned numbers
      - All Owned numbers including sub-accounts
      - Set SMS URL
      - Set SMS Delivery Notification URL to a Number
      - Set Number Friendly Name
      - Set SMS Contact
      - Get SMS Contact
      - SMS Enable Landline Numbers
      - Add Number To TCR Campaign
      - Remove Number From TCR Campaign
      - Number Tags
      - Phone Lookup
      - Bulk-phone-lookup
    
    ---
    
    For API access and permissions, please contact your designated TxTRIA account representative.
    
  version: "1.0.0"

servers:
  - url: https://txtria.net/api
  
tags:
  - name: Accounts
    description: Manage your TxTRIA account settings
  - name: Messaging
    description: Send and manage SMS messages
  - name: Phone Number
    description: Manage SMS/MMS phone numbers

paths:
  /accountinfo:
    post:
      tags:
        - Accounts
      summary: Get Account Info
      description: Get your TxTRIA account details.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [sys_id, auth_token]
              properties:
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","data":{"account_status":"active","account_type":"Executive","account_balance":"5,621.87366","account_join":"2020-05-30 22:03:38","account_last_login":"2025-07-01 16:17:40","account_last_payment":"5000.00","account_last_payment_date":"2025-07-05 05:15:04","account_last_charge":"0.0049","account_last_transaction_type":"phone_lookup","account_last_transaction_date":"2025-07-05 15:03:05"}}
        "401":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }        
          

  /setaccsmsdn:
    post:
      tags:
        - Accounts
      summary: Set SMS Delivery URL
      description: >
        Set the URL to receive asynchronous SMS delivery notifications. Delivery status may vary and is not guaranteed. Notifications will be POSTed to the provided URL using the message ID as a reference.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [url, sys_id, auth_token]
              properties:
                url:
                  type: string
                  format: uri
                  description: Delivery notifications will be sent to this URL
                  example: https://mysys.com/setaccsmsdn
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","message":"Successfully set delivery notification URL"}
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
                
  /sendsms:
    post:
      tags:
        - Messaging
      summary: Send SMS
      description: Send an outbound SMS from your TxTRIA account.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [To, From, Body, sys_id, auth_token]
              properties:
                To:
                  type: string
                  description: Phone number you want to send SMS to
                  example: +1832324XXXX
                From:
                  type: string
                  description: TxTRIA number you want to send SMS from
                  example: 562742XXXX
                Body:
                  type: string
                  description: SMS text
                  example: Hello!
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","status":"queued","message":"Message queued successfully","tracking_id":"e95aba865ae....."}         
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
                
  /sendmms:
    post:
      tags:
        - Messaging
      summary: Send MMS
      description: Send an outbound SMS from your TxTRIA account.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [To, From, Body, FileName0, MediaUrl0, sys_id, auth_token]
              properties:
                To:
                  type: string
                  description: Phone number you want to send MMS to
                  example: +1832324XXXX
                From:
                  type: string
                  description: TxTRIA number you want to send MMS from
                  example: 562742XXXX
                Body:
                  type: string
                  description: SMS text
                  example: Hello!
                Subject:
                  type: string
                  description: Subject text
                  example: Hello!
                FileName0:
                  type: string
                  description:   Media File Name
                  example: samplemms.png
                MediaUrl0:
                  type: string
                  description: The URL of the media. The linked-media should not exceed 800kb in general, but depends on handset.
                  example: https://txtria.net/images/samplemms.png
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","status":"queued","message":"Message queued successfully","tracking_id":"e95aba865ae....."}         
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
                
  /sendsmssc:
    post:
      tags:
        - Messaging
      summary: Send Shortcode SMS/MMS
      description: Send an outbound SMS from your TxTRIA Shortcode account.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [To, From, Body, sys_id, auth_token]
              properties:
                To:
                  type: string
                  description: Phone number you want to send SMS to
                  example: +1832324XXXX
                From:
                  type: string
                  description: TxTRIA Shortcode
                  example: 82888
                Body:
                  type: string
                  description: SMS text
                  example: Your one-time security code is 123456. Submit online. Never share. Msg&Data rates may apply. Reply Stop if unexpected/Help for support.
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","status":"queued","message":"Message queued successfully","tracking_id":"e95aba865ae....."}      
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /smshistory:
    post:
      tags:
        - Messaging
      summary: Get SMS History
      description: Get SMS history from your TxTRIA account
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, history_start, history_end, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number you want to fetch records for
                  example: +1832324XXXX
                tid:
                  type: string
                  description: TxTRIA number tid
                  example: 562742XXXX
                history_start:
                  type: string
                  description: integer, fetching records will start from this number
                  example: 1
                history_end:
                  type: string
                  description: integer, fetching records will end from this number
                  example: 100
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","message_count_requested ":100,"total_message_count":134839,"created_date":"2025-07-01 00:19:03","most_recent_msg_id":"6073718fbbd7dc......","most_recent_date":"2025-07-05 15:56:07","tid":"672942.....","number":"555777XXXX","optin":"yes","messages":[{"system_id":"1205655555","message_id":"6073718fbbd7dc......","GMTdate":"2025-07-05 15:57:08","tid":"672942.....","phone":"555444XXXX","direction":"outbound","body":"hello!","mms":"no","mms_url":"","status":"200"}]}      
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /phonehistory:
    post:
      tags:
        - Messaging
      summary: Get Phone History
      description: Get Phone history from your TxTRIA account
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number you want to fetch records for
                  example: +1832324XXXX
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /phoneblock:
    post:
      tags:
        - Messaging
      summary: Block / Unblock Phone
      description: Blocked numbers cannot send/receive messages
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, permissions, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Phone number you want to fetch records for
                  example: +1832324XXXX
                tid:
                  type: string
                  description: TxTRIA number tid
                  example: 562742XXXX
                permissions:
                  type: string
                  description: Use 0 to block and 1 to allow
                  example: 0
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {"success":"1","status":"blocked|unblocked","message":"Blocked|Unblocked successfully"}
   
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
                
  /messaginghistory:
    post:
      tags:
        - Messaging
      summary: Get Messaging History
      description: Get messaging history from your TxTRIA account
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, start_date, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number you want to fetch records for
                  example: +1832324XXXX
                tid:
                  type: string
                  description: TxTRIA number tid
                  example: 562742XXXX
                start_date:
                  type: string
                  description: fetching records will start after this date
                  example: 2025-07-05 12:24:55
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "start_date ": "2011-01-01 14:30:00",
                    "total_message_after_date": 4700,
                    "total_incoming_count": 1500,
                    "total_outgoing_count": 3200,
                    "last_incoming_date": "2019-04-26 08:30:24",
                    "last_outgoing_date": "2019-08-26 09:21:04",
                    "total_incoming_since_last_outgoing": 3,
                    "most_recent_message_direction": "inbound",
                    "tid": "GFSDA5423",
                    "number": "7894654654"
                }          
          
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /dlrlookup:
    post:
      tags:
        - Messaging
      summary: DLR Status Lookup
      description: Retrieve the Delivery Report (DLR) status for a message sent via TxTRIA. This API is not intended for CRM integration or ongoing DLR tracking. Clients should store DLRs by using the 'DLR URLs' configured in the Manage Phone Number Settings or by implementing the Set SMS DLR URL API for proper delivery tracking.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [tracking_id, sys_id, auth_token]
              properties:
                tracking_id:
                  type: string
                  description: Tracking id provided after sending a text message
                  example: 6e3edca8cee7471eeed2dfcbc4ef106d
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "id": "d-413f7e59",
                    "send_status": "Delivered",
                    "status": "Delivered",
                    "status_pure": "DELIVRD||001",
                    "status_mapped": 200,
                    "status_raw": "0",
                    "error": 200,
                    "time": "2023-03-12 21:33:45",
                    "source": "15557778888",
                    "destination": "15554443333",
                    "uuid": "d-417f7e59",
                    "tracking_id": "6e3edca8cee7471eeed2dfcbc4ef106d"
                }   
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /sendpoolsms:
    post:
      tags:
        - Messaging
      summary: Send Pool SMS
      description: Send an outbound SMS via Pools API from your TxTRIA account.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [To, pool_id, Body, sys_id, auth_token]
              properties:
                To:
                  type: string
                  description: Phone number you want to send SMS to
                  example: +1832324XXXX
                pool_id:
                  type: string
                  description: TxTRIA pool_id you want to send SMS from
                  example: 5CA5A20A9D300
                Body:
                  type: string
                  description: SMS text
                  example: Hello!
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "status": "queued",
                    "message": "Message queued successfully",
                    "tracking_id": "b0c5381b8db3b06decec42560112XXXX",
                    "mobile_phone": "+183232XXXXX",
                    "assigned_pool_phone": "58760XXXXX"
                } 
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /getpools:
    post:
      tags:
        - Messaging
      summary: List Pools
      description: List available TxTRIA local numbers.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [sys_id, auth_token]
              properties:
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "pool_id": "5CA5A20A9D300",
                            "pool_name": "Test Pool",
                            "pool_type": "DID",
                            "number_count": "25",
                            "sms_sent": "25",
                            "avg_daily_sent_per_number": "1",
                            "avg_daily_sent_all_numbers": "4",
                            "webhook": "https://webhook.com/123",
                            "provisioned": "true"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }


  /gettollfreenumbers:
    post:
      tags:
        - Phone Number
      summary: List Tollfree Numbers
      description: Get a list of available TxTRIA Tollfree numbers
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "number": "8332022818"
                        },
                        {
                            "number": "8332022820"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /buytollfreenumber:
    post:
      tags:
        - Phone Number
      summary: Buy Tollfree Number
      description: Buy a TxTRIA Tollfree number from the list of available numbers
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Tollfree number from the list of available numbers
                  example: 8332022818
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": {
                        "TID": 5765786,
                        "number": "8332022818"
                    }
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /getstates:
    post:
      tags:
        - Phone Number
      summary: List States
      description: List States
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "AB": "Alberta",
                            "AK": "Alaska",
                            "AL": "Alabama",
                            "AR": "Arkansas",
                            "AZ": "Arizona"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /getratecenter:
    post:
      tags:
        - Phone Number
      summary: List Ratecenters
      description: List ratecenters in a given state
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [state]
              properties:
                state:
                  type: string
                  description: Number state  
                  example: CA
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "state": "BC",
                            "ratecenter": "ABBOTSFORD",
                            "areacodes": [
                                "778"
                            ]
                        },
                        {
                            "state": "BC",
                            "ratecenter": "KELOWNA",
                            "areacodes": [
                                "778"
                            ]
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /getnumbers:
    post:
      tags:
        - Phone Number
      summary: List Available Local Numbers
      description: List available TxTRIA local numbers.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [state, ratecenter]
              properties:
                state:
                  type: string
                  description: Number state  
                  example: CA
                ratecenter:
                  type: string
                  description: Rate-center in the given state
                  example: AGOURA
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "number": "8332022818",
                            "state": "BC",
                            "ratecenter": "VICTORIA"
                        },
                        {
                            "number": "8332022819",
                            "state": "BC",
                            "ratecenter": "VICTORIA"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /searchnumber:
    post:
      tags:
        - Phone Number
      summary: Search Available Local Numbers
      description: Search TxTRIA local numbers
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [state, ratecenter]
              properties:
                state:
                  type: string
                  description: Number state  
                  example: CA
                ratecenter:
                  type: string
                  description: Rate-center in the given state
                  example: AGOURA
                npa:
                  type: string
                  description: Area Code  
                  example: 734
                search:
                  type: string
                  description: Search LC containing number
                  example: 5753
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "number": "8332022818",
                            "state": "BC",
                            "npa": "734"
                        },
                        {
                            "number": "8332022819",
                            "state": "BC",
                            "npa": "734"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /buylocalnumber:
    post:
      tags:
        - Phone Number
      summary: Buy Local Number
      description: Buy a TxTRIA local number from the list of available numbers
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Local number from the list of available numbers
                  example: 7342022818
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": {
                        "TID": 5765786,
                        "number": "8332022818"
                    }
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /getnumbertid:
    post:
      tags:
        - Phone Number
      summary: Get Number TID
      description: Get Number TID
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "TID": "5C179E3513E36",
                            "number": "8332022818"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /releasenumber:
    post:
      tags:
        - Phone Number
      summary: Release Number
      description: Release a TxTRIA Number.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Number 8332022818 has been removed successfully. You can bring this number back anytime within 10 days. After 10 days number will be removed permanently"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
        
  /restorenumber:
    post:
      tags:
        - Phone Number
      summary: Restore Number
      description: Restore a number that you have released.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Number 8332022818 has been restored successfully."
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /ownednumbers:
    post:
      tags:
        - Phone Number
      summary: Owned numbers
      description: Get a list of your owned numbers.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "number": "5627424XXX",
                            "tid": "5C179E3513XXX",
                            "type": "local",
                            "webhook": "https:\/\/webhook.com\/123",
                            "dlr": "https:\/\/dlr.com\/123"
                        },
                        {
                            "number": "5627424XXX",
                            "tid": "5C179E3513XXX",
                            "type": "local",
                            "webhook": "https:\/\/webhook.com\/123",
                            "dlr": "https:\/\/dlr.com\/123"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /allownednumbers:
    post:
      tags:
        - Phone Number
      summary: All Owned numbers including sub-accounts
      description: Get a list of your owned numbers.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [sys_id, auth_token]
              properties:
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": [
                        {
                            "number": "5627424XXX",
                            "tid": "5C179E3513XXX",
                            "type": "local",
                            "webhook": "https:\/\/webhook.com\/123",
                            "dlr": "https:\/\/dlr.com\/123"
                        },
                        {
                            "number": "5627424XXX",
                            "tid": "5C179E3513XXX",
                            "type": "tollfree",
                            "webhook": "https:\/\/webhook.com\/123",
                            "dlr": "https:\/\/dlr.com\/123"
                        }
                    ]
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /smsurl:
    post:
      tags:
        - Phone Number
      summary: Set SMS URL
      description: Set SMS URL to any number that you own.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, url, universal, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                url:
                  type: string
                  description: Inbound messages will be sent to this URL
                  example:   https://mysys.com/smsurl
                universal:
                  type: string
                  description: Make change to all live numbers in account
                  example: true
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...    
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "SMS URL has been updated successfully"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /setsmsdn:
    post:
      tags:
        - Phone Number
      summary: Set SMS Delivery Notification URL to a Number
      description: Delivery Notifications are only supported via our API. We don't support delivery notifications via Jabber/XMPP or Slack.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, url, universal, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                url:
                  type: string
                  description: Inbound messages will be sent to this URL
                  example:   https://mysys.com/smsurl
                universal:
                  type: string
                  description: Make change to all live numbers in account
                  example: true
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...    
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Successfully set delivery notification URL"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /setfriendlyname:
    post:
      tags:
        - Phone Number
      summary: Set Number Friendly Name
      description: Give your TxTRIA number a custom name.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, friendly_name, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                friendly_name:
                  type: string
                  description: Formatted Number
                  example: (587) 600-0060
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Successfully set friendly name"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /setsmscontact:
    post:
      tags:
        - Phone Number
      summary: Set SMS Contact
      description: Set SMS Contact
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                first_name:
                  type: string
                  description: String
                  example: Devin
                last_name:
                  type: string
                  description: String
                  example: L
                email:
                  type: string
                  description: String
                  example: email@somedomain.com
                notes:
                  type: string
                  description: String maximum 1000 characters
                  example: Some notes
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Successfully set SMS contact"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /getsmscontact:
    post:
      tags:
        - Phone Number
      summary: Get SMS Contact
      description: Get SMS Contact
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, tid, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: TxTRIA phone number that you own
                  example: 8332022818
                tid:
                  type: string
                  description: Number TID required to release a number
                  example: 5C17988813E36
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": {
                        "number": "587600XXXX",
                        "tid": "5CA5A2C8XXXX5",
                        "first_name": "Devin",
                        "last_name": "L",
                        "email": "email@somedomain.com",
                        "notes": "Some notes"
                    }
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }

  /offnetsubmit:
    post:
      tags:
        - Phone Number
      summary: SMS Enable Landline Numbers
      description: Get SMS Contact
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Landline number
                  example: 587600XXXX
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /tcr/submit:
    post:
      tags:
        - Phone Number
      summary: Add Number To TCR Campaign
      description: Add Number To TCR Campaign
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, campaign_id, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Landline number
                  example: 587600XXXX
                campaign_id:
                  type: string
                  description: Campaign ID to add number to
                  example: CFRTYUS
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Number added to campaign"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /tcr/campaign-number-remove:
    post:
      tags:
        - Phone Number
      summary: Remove Number From TCR Campaign
      description: Remove Number From TCR Campaign
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, campaign_id, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Landline number
                  example: 587600XXXX
                campaign_id:
                  type: string
                  description: Campaign ID to remove number from
                  example: CFRTYUS
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "Number removed from campaign"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /tags:
    post:
      tags:
        - Phone Number
      summary: Number Tags
      description: Add/Remove phone number tags. Use the 'add' action to add a tag to the system to begin tagging phone numbers. Use the 'delete' action to remove a tag from the system and clear the tag assigned to any phone number. Use the 'get' action to get a list of phone numbers with a tag. Use 'set' and 'unset' action to give a phone number a tag and remove a tag from a phone number.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [action, name, number, tag_id, sys_id, auth_token]
              properties:
                action:
                  type: string
                  description: Tagging functions (add, delete, get, set, or unset)
                  example: set              
                name:
                  type: string
                  description: Name of your tag (add)
                  example: MyTag1              
                number:
                  type: string
                  description: Number you want to tag or untag (set, unset)
                  example: 8332022818
                tag_id:
                  type: string
                  description: Tag id assigned when a tag is created/added (delete, get, set, unset)  
                  example: e2936c097d03c72e69afc1fbd962d3b4
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "message": "e2936c097d03c72e69afc1fbd962d3b4"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
          
  /phone-lookup:
    post:
      tags:
        - Phone Number
      summary: Phone Lookup
      description: Phone Lookup
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [number, sys_id, auth_token]
              properties:
                number:
                  type: string
                  description: Phone Number
                  example: 587600XXXX
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": true,
                    "carrier_code": "15942",
                    "carrier_name": "GOOGLE (GRAND CENTRAL) BWI - BANDWIDTH.COM - SVR",
                    "number_type": "VM",
                    "country_iso_code": "USA",
                    "validity": "true"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                "error": "1",
                "message": "reason text"
                }
        
  /bulk-phone-lookup:
    post:
      tags:
        - Phone Number
      summary: bulk-phone-lookup
      description: bulk-phone-lookup
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required: [csv_url, notify_url, sys_id, auth_token]
              properties:
                csv_url:
                  type: string
                  description: |
                  
                    URL pointing to the CSV file.  Valid Format.
                  
                    ![Delivery Flow](https://developer.txtria.net/console_assets/images/phone-lookup-csv.png)
                  example: https://mydomain.com/lookup/job1.csv
                notify_url:
                  type: string
                  description: |
                    TxTRIA will send a post to this URL on completion
                    
                    Post will contain following information
                    
                    bulk_lookup_completed => 1
                    
                    batch_key => B8c92b641a48033aa11ba07a9b2ac5a01
                    
                    bulk_lookup_file => URL to download CSV
                    
                    completed => 2022-01-20 10:30:00
                  example: 587600XXXX 
                notify_email:
                  type: string
                  description: If given, TxTRIA will send an email notification about completion to this address
                  example: myemail@domain.com
                sys_id:
                  type: string
                  description: Your TxTRIA sys_id
                  example: ACfc98e7b0aae031b9h...
                auth_token:
                  type: string
                  description: Your TxTRIA account token
                  example: c74eac89884a126a2c...      
      responses:
        "200":
          description: Success
          content:
            application/json:
              example:
                {
                    "success": "1",
                    "data": {
                        "batch_key": "B8c92b641a48033aa11ba07a9b2ac5001",
                        "total_cost": "0.00195",
                        "total_numbers": 3
                    },
                    "message": "Process initiated successfully!"
                }
        "400":
          description: Invalid input.
          content:
            application/json:
              example:
                {
                  "error": "1",
                  "message": "reason text"
                }
                
                
                
              