{
  "info": {
    "name": "SMSUP Plus API",
    "description": "SMSUP Plus public API — https://docs.smsup-plus.com",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://public-api.smsup-plus.com"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "sender",
      "value": ""
    },
    {
      "key": "msisdn",
      "value": ""
    },
    {
      "key": "bulkId",
      "value": ""
    },
    {
      "key": "otcId",
      "value": ""
    },
    {
      "key": "otpId",
      "value": ""
    },
    {
      "key": "otpCode",
      "value": ""
    },
    {
      "key": "shortCode",
      "value": ""
    },
    {
      "key": "lineTokenId",
      "value": ""
    },
    {
      "key": "personId",
      "value": ""
    },
    {
      "key": "destinationId",
      "value": ""
    },
    {
      "key": "tagId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "SMS",
      "item": [
        {
          "name": "Send SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "send"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messages\": [\n    {\n      \"from\": \"{{sender}}\",\n      \"destinations\": [\n        { \"to\": \"{{msisdn}}\" }\n      ],\n      \"text\": \"Hello from SMSUP Plus\",\n      \"notifyUrl\": \"https://example.com/sms/dr\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Send an SMS to one or more Thai mobile numbers; returns per-recipient status."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "if (body.bulkId) pm.collectionVariables.set('bulkId', body.bulkId);"
                ]
              }
            }
          ]
        },
        {
          "name": "Preview SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "preview"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"messages\": [\n    {\n      \"from\": \"{{sender}}\",\n      \"destinations\": [\n        { \"to\": \"{{msisdn}}\" }\n      ],\n      \"text\": \"สวัสดีครับ คำสั่งซื้อของคุณจัดส่งแล้ว\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Calculate credit and encoding for a message without sending it."
          }
        },
        {
          "name": "Sender List",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sms/senderlist",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "senderlist"
              ]
            },
            "description": "List the sender names approved for the account."
          }
        },
        {
          "name": "SMS Log Info",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/sms/loginfo?bulkId={{bulkId}}&page=1&pageSize=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "loginfo"
              ],
              "query": [
                {
                  "key": "bulkId",
                  "value": "{{bulkId}}"
                },
                {
                  "key": "messageId",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "mobile",
                  "value": "66812345678",
                  "disabled": true
                },
                {
                  "key": "dateFrom",
                  "value": "2026-11-01T00:00:00+07:00",
                  "disabled": true
                },
                {
                  "key": "dateTo",
                  "value": "2026-11-30T23:59:59+07:00",
                  "disabled": true
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "pageSize",
                  "value": "20"
                }
              ]
            },
            "description": "Search SMS send history and delivery status, paginated, newest first."
          }
        }
      ]
    },
    {
      "name": "OTP",
      "item": [
        {
          "name": "Request OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/OTP/requestotp",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "OTP",
                "requestotp"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"otcid\": \"{{otcId}}\",\n  \"mobile\": \"{{msisdn}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Generate an OTP and send it by SMS; saves otpId and referenceCode to collection variables."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const body = pm.response.json();",
                  "if (body.otpId) pm.collectionVariables.set('otpId', body.otpId);",
                  "if (body.referenceCode) pm.collectionVariables.set('referenceCode', body.referenceCode);",
                  "pm.test('OTP sent', () => pm.expect(body.success && body.success.message).to.eql('SUCCESS'));"
                ]
              }
            }
          ]
        },
        {
          "name": "Verify OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/OTP/verifyotp",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "OTP",
                "verifyotp"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"otpid\": \"{{otpId}}\",\n  \"otpcode\": \"{{otpCode}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Verify the code the user entered against an otpId (set otpCode to the code from the SMS)."
          }
        },
        {
          "name": "Resend OTP",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/OTP/resendotp",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "OTP",
                "resendotp"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"otpid\": \"{{otpId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Send a new OTP code for an existing otpId (same reference code, lifetime not extended)."
          }
        }
      ]
    },
    {
      "name": "URL Shortener",
      "item": [
        {
          "name": "Create Short URL",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "pm.test('status 200', () => pm.expect(json.status).to.eql(200));",
                  "if (json.data && json.data.shortCode) {",
                  "  pm.collectionVariables.set('shortCode', json.data.shortCode);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/shorten/create",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shorten",
                "create"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://www.example.com/promotion?utm_source=sms\",\n  \"messageId\": \"PROMO-2026-11\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "description": "Create a short URL for an http/https destination; saves shortCode to a collection variable."
        },
        {
          "name": "List Short URLs",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shorten/list?page=1&pageSize=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shorten",
                "list"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "pageSize",
                  "value": "20"
                }
              ]
            }
          },
          "description": "List the account's active short URLs, newest first, paginated."
        },
        {
          "name": "Short URL Stats",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/shorten/stats/{{shortCode}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "shorten",
                "stats",
                "{{shortCode}}"
              ],
              "query": []
            }
          },
          "description": "Get details and click count of one short URL."
        },
        {
          "name": "Open Short URL (Redirect)",
          "protocolProfileBehavior": {
            "followRedirects": false
          },
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/s/{{shortCode}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "s",
                "{{shortCode}}"
              ],
              "query": []
            }
          },
          "description": "Public redirect hit by recipients: 302 to the destination URL (counts a click), 404 if unknown."
        }
      ]
    },
    {
      "name": "LINE",
      "item": [
        {
          "name": "Send LINE Notify Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/line/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "line",
                "send"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tokenId\": \"{{lineTokenId}}\",\n  \"message\": \"Notice: order #10023 has shipped\",\n  \"imageUrl\": \"https://www.example.com/images/shipped.png\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "description": "Send a message (optional image) via a LINE Notify token of the account (legacy; LINE Notify is discontinued)."
        },
        {
          "name": "LINE Token Dashboard",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/line/dashboard",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "line",
                "dashboard"
              ],
              "query": []
            }
          },
          "description": "List the account's active LINE Notify tokens (tokenId, name, isActive)."
        }
      ]
    },
    {
      "name": "Consent",
      "item": [
        {
          "name": "Check Consent",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/Consent/checkconsent/{{msisdn}}?type=marketing",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Consent",
                "checkconsent",
                "{{msisdn}}"
              ],
              "query": [
                {
                  "key": "type",
                  "value": "marketing",
                  "description": "Optional consentType filter"
                }
              ]
            }
          },
          "description": "Get the latest consent record of a mobile number (optionally of one consentType)."
        },
        {
          "name": "Save Consent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Consent/saveconsent",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Consent",
                "saveconsent"
              ],
              "query": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mobile\": \"{{msisdn}}\",\n  \"consentType\": \"marketing\",\n  \"granted\": true,\n  \"source\": \"web\",\n  \"note\": \"Subscribed to news on the website\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "description": "Append a consent record for a mobile number; use granted=false to withdraw."
        }
      ]
    },
    {
      "name": "Contacts",
      "item": [
        {
          "name": "Search Contacts",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/requestPerson",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "requestPerson"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"search\": \"\",\n  \"tag\": \"\",\n  \"page\": 1,\n  \"pageSize\": 20\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "List contacts with optional search/tag filter, paginated (alias: /Person/SearchPerson)."
          }
        },
        {
          "name": "Add Contact",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "if (json.status === 200 && json.data && json.data.personId) {",
                  "  pm.collectionVariables.set('personId', json.data.personId);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/insertPerson",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "insertPerson"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"firstName\": \"Somchai\",\n  \"lastName\": \"Jaidee\",\n  \"email\": \"somchai@example.com\",\n  \"phone\": \"{{msisdn}}\",\n  \"companyName\": \"Example Co., Ltd.\",\n  \"note\": \"Created from Postman\",\n  \"tags\": [\"VIP\"]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create a contact; saves data.personId into {{personId}}."
          }
        },
        {
          "name": "Update Contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/updatePerson",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "updatePerson"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"personId\": \"{{personId}}\",\n  \"note\": \"Updated from Postman\",\n  \"tags\": [\"VIP\", \"Gold\"]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Update a contact; only non-empty fields change, tags replaces the whole list."
          }
        },
        {
          "name": "Delete Contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/deletePerson",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "deletePerson"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"personId\": \"{{personId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Delete a contact."
          }
        },
        {
          "name": "Add Destination",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "if (json.status === 200 && json.data && json.data.destinationId) {",
                  "  pm.collectionVariables.set('destinationId', json.data.destinationId);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/insertPersonDestination",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "insertPersonDestination"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"personId\": \"{{personId}}\",\n  \"value\": \"{{msisdn}}\",\n  \"isPrimary\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Add a phone/email destination to a contact; saves data.destinationId into {{destinationId}}."
          }
        },
        {
          "name": "Delete Destination",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Person/DeletePersonDestination",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Person",
                "DeletePersonDestination"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"destinationId\": \"{{destinationId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Delete a contact destination (path is case-sensitive: capital D)."
          }
        }
      ]
    },
    {
      "name": "Tags",
      "item": [
        {
          "name": "List Tags",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Tag/requestTag",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Tag",
                "requestTag"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"search\": \"\",\n  \"page\": 1,\n  \"pageSize\": 50\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "List tags with optional name search, paginated."
          }
        },
        {
          "name": "Create Tag",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const json = pm.response.json();",
                  "if (json.status === 200 && json.data && json.data.tagId) {",
                  "  pm.collectionVariables.set('tagId', json.data.tagId);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Tag/insertTag",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Tag",
                "insertTag"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"VIP\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create a tag; saves data.tagId into {{tagId}}."
          }
        },
        {
          "name": "Delete Tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Tag/deleteTag",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Tag",
                "deleteTag"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"tagId\": \"{{tagId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Delete a tag."
          }
        },
        {
          "name": "Assign Tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Tag/insertPersonTag",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Tag",
                "insertPersonTag"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"personId\": \"{{personId}}\",\n  \"tagId\": \"{{tagId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Assign a contact to a tag."
          }
        },
        {
          "name": "Unassign Tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Tag/deletePersonTag",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Tag",
                "deletePersonTag"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"personId\": \"{{personId}}\",\n  \"tagId\": \"{{tagId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Remove a contact from a tag."
          }
        }
      ]
    },
    {
      "name": "Blacklist",
      "item": [
        {
          "name": "List Blacklist",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Blacklist/requestBlacklist",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Blacklist",
                "requestBlacklist"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"search\": \"\",\n  \"page\": 1,\n  \"pageSize\": 50\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "List blacklisted numbers with optional search on mobile/reason, paginated."
          }
        },
        {
          "name": "Add to Blacklist",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Blacklist/insertBlacklist",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Blacklist",
                "insertBlacklist"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mobile\": \"{{msisdn}}\",\n  \"reason\": \"Customer opted out\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Blacklist a number; use 66XXXXXXXXX format or it will not block sends."
          }
        },
        {
          "name": "Remove from Blacklist",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/Blacklist/deleteBlacklist",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "Blacklist",
                "deleteBlacklist"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mobile\": \"{{msisdn}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Remove a number from the blacklist (must match the stored value exactly)."
          }
        }
      ]
    }
  ]
}
