> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pinnacle.sh/v-2/api-reference/messages/validate-sms/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server. # Validate SMS Message POST https://api.pinnacle.sh/messages/validate/sms Content-Type: application/json Validate SMS message content without sending it. Reference: https://docs.pinnacle.sh/api-reference/messages/validate-sms ## Authentication - `PINNACLE-API-KEY` header (required) — API Key authentication via header ## Request ### Body (application/json) This endpoint expects a SMSContent. - `text` (string, required) — Message content. ## Response ### 200 Returns the validation results. - `segments` (SmsValidationResponseSegments, required) — Details about how the SMS content would be segmented for delivery. - `total` (SmsValidationResponseTotal, required) - `unit` (double, required) — Cost per message segment. - `isOverSegmentLimit` (boolean, optional) — Indicates if the message exceeds the allowed segment limit. For SMS, this is limit is 10. ## Errors ### 400 Bad Request Error Validation failed. The payload has missing required fields and/or invalid types. See [https://zod.dev/error-formatting](https://zod.dev/error-formatting) for more information. - `description` (string, required) — Human-readable summary of validation failures. - `errors` (ZodErrorErrors, required) — Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ### 401 Unauthorized Error The request lacks valid authentication credentials or the provided credentials are invalid. Ensure you're including a valid API key in the request headers and that your account has the necessary permissions to access this endpoint. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 403 Forbidden Error Your subscription does not include access to this feature. This occurs when attempting to use functionality that requires a higher subscription tier. Please upgrade your subscription to access this feature. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ### 500 Internal Server Error An unexpected error occurred on Pinnacle's servers while processing your request. If this error persists, please contact support with the request details. - `error` (string, required) — Human-readable description of the error that occurred, corresponding to the HTTP status code. ## Types ### SmsValidationResponseSegments Details about how the SMS content would be segmented for delivery. - `gsm7` (SmsValidationResponseSegmentsGsm7, required) — Segmentation details when your message is encoded with GSM-7. - `utf16` (SmsValidationResponseSegmentsUtf16, required) — Segmentation details when your message is encoded with UTF-16. ### SmsValidationResponseTotal - `gsm7` (double, required) — Total price of this message. Calculated by multiplying the number of GSM-7 segments by the unit cost. You must remove all unsupported UTF-16 characters before this message can be sent as GSM-7. - `utf16` (double, required) — Total price of this message. Calculated by multiplying the number of UTF-16 segments by the unit cost. ### ZodErrorErrors Structured dictionary of issues containing two main sections: - `errors`: Array of global validation errors not tied to specific fields - `properties`: Object mapping field names to their specific validation errors, where each field contains an `errors` array ### SmsValidationResponseSegmentsGsm7 Segmentation details when your message is encoded with GSM-7. - `totalBytes` (integer, required) — Total number of bytes used by the GSM-7 segments. - `unsupported` (list of string, required) — Characters not supported by GSM-7 encoding. - `value` (list of string, required) — Message broken down into segments using GSM-7 encoding. ### SmsValidationResponseSegmentsUtf16 Segmentation details when your message is encoded with UTF-16. - `totalBytes` (integer, required) — Total number of bytes used by the UTF-16 segments. - `value` (list of string, required) — Message broken down into segments using UTF-16 encoding. ## Examples **Request** ```json { "text": "Hello from Pinnacle" } ``` **Response** ```json { "segments": { "gsm7": { "totalBytes": 11, "unsupported": [], "value": [ "Hello from Pinnacle" ] }, "utf16": { "totalBytes": 24, "value": [ "Hello from Pinnacle" ] } }, "total": { "gsm7": 0.01, "utf16": 0.01 }, "unit": 0.01, "isOverSegmentLimit": false } ``` **SDK Code** ```python SMS Validation import requests url = "https://api.pinnacle.sh/messages/validate/sms" payload = { "text": "Hello from Pinnacle" } headers = { "PINNACLE-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript SMS Validation const url = 'https://api.pinnacle.sh/messages/validate/sms'; const options = { method: 'POST', headers: {'PINNACLE-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"text":"Hello from Pinnacle"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go SMS Validation package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.pinnacle.sh/messages/validate/sms" payload := strings.NewReader("{\n \"text\": \"Hello from Pinnacle\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("PINNACLE-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby SMS Validation require 'uri' require 'net/http' url = URI("https://api.pinnacle.sh/messages/validate/sms") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["PINNACLE-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"text\": \"Hello from Pinnacle\"\n}" response = http.request(request) puts response.read_body ``` ```java SMS Validation import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.pinnacle.sh/messages/validate/sms") .header("PINNACLE-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"text\": \"Hello from Pinnacle\"\n}") .asString(); ``` ```php SMS Validation request('POST', 'https://api.pinnacle.sh/messages/validate/sms', [ 'body' => '{ "text": "Hello from Pinnacle" }', 'headers' => [ 'Content-Type' => 'application/json', 'PINNACLE-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp SMS Validation using RestSharp; var client = new RestClient("https://api.pinnacle.sh/messages/validate/sms"); var request = new RestRequest(Method.POST); request.AddHeader("PINNACLE-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"text\": \"Hello from Pinnacle\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift SMS Validation import Foundation let headers = [ "PINNACLE-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["text": "Hello from Pinnacle"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.pinnacle.sh/messages/validate/sms")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > One API for RCS, iMessage, MMS, and SMS. Build, test, and scale every channel — send your first message in minutes, not weeks.