### Example 200 response for GET /v5/dids/{number} Source: https://docs.tsgglobal.com/openapi-specification Example 200 response for the GET /v5/dids/{number} endpoint. Shows the configuration object with all fields, including nullable values and enums. ```json { "number": "text", "number_type": "long-code", "mms_enabled": true, "mms_uri": null, "sms_enabled": true, "campaign_id": null, "compliance_status": "non_compliant", "sms_status": "NONE", "use_case_type": "", "nnid": null, "sms_post_ver": "smpp", "sms_uri": null, "x_api_key_header": null, "ten_dlc_registered": true, "tmobile_ten_dlc_registered": true } ``` -------------------------------- ### Example response for GET /mms/templates Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/list-mms-templates Example JSON response returned by the GET /mms/templates endpoint, containing an array of MMS template objects. Each object includes id, type, and attributes like name, parts (with URIs and content types), timestamps, placeholders, and body/subject templates. ```json { "data": [ { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png", "headers": {}, "content_type": "image/png", "content_location": "unnamed-1.png" } ], "inserted_at": "2026-03-20T19:53:02.165449", "updated_at": "2026-03-20T19:53:02.165449", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "491aa990-1fbb-4058-8af0-c78049010d2f", "type": "mms-template" }, { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/185f821e-aac8-4296-88f4-035f155087f5/templates/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/185f821e-aac8-4296-88f4-035f155087f5/templates/2-unnamed-1.png", "headers": {}, "content_type": "image/png", "content_location": "unnamed-1.png" } ], "inserted_at": "2026-03-20T17:08:33.315490", "updated_at": "2026-03-20T17:08:33.315490", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "185f821e-aac8-4296-88f4-035f155087f5", "type": "mms-template" }, { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/0a4cfbcc-533f-4a87-aed7-e49bdfc20025/templates/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" } ], "inserted_at": "2026-03-20T16:53:12.572326", "updated_at": "2026-03-20T16:53:12.572326", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "0a4cfbcc-533f-4a87-aed7-e49bdfc20025", "type": "mms-template" } ] } ``` -------------------------------- ### Example response with placeholders Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/send-mms-using-template Response to the example request with placeholders. Shows the message ID, parts including a plain text part and URI parts for 'brochure.txt' and 'unnamed-1.png', and the subject 'Hello Jane'. ```json { "data": { "attributes": { "messages": [ { "to": "17818434375", "message_id": "035273d3-c20d-47ee-9d4c-7b732d36fbe0" } ], "from": "18003004001", "parts": [ { "kind": "plain", "content_type": "text/plain", "transfer_encoding": "identity", "content_encoding": "identity" }, { "kind": "uri", "transfer_encoding": "identity", "content_encoding": "identity", "content_location": "brochure.txt" }, { "kind": "uri", "transfer_encoding": "identity", "content_encoding": "identity", "content_location": "unnamed-1.png" } ], "to": [ "17818434375" ], "inserted_at": "2026-03-20T19:53:33.795259", "subject": "Hello Jane", "headers": {}, "expires_at": null, "transaction_id": "e261793b-da9a-400f-9231-22e736af4d1c" }, "id": "e13b4f90-5a39-405d-a729-0f2b9bca9d60", "type": "mms-forward-res" } } ``` -------------------------------- ### Example response for orderTollfreeNumbersMutation Source: https://docs.tsgglobal.com/api-reference/phone-numbers/toll-free-phone-numbers-search-and-ordering Example response from the orderTollfreeNumbersMutation mutation, returning the ordered numbers and an order ID. ```json { "data": { "orderTollfreeNumbers": { "numbers": ["18886830411"], "orderId":"999000261-ORD" } } } ``` -------------------------------- ### Enable MMS Response Example Source: https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-mms/enable-mms-on-a-number Example response body returned when MMS is successfully enabled on a number. Shows the MMS URI, number, and SMS status. ```json { "mms_enabled": true, "mms_uri": "http://mms.example.com", "number": "12342341234", "sms_enabled": true, "sms_uri": null # null means SMPP } ``` -------------------------------- ### Example response without placeholders Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/send-mms-using-template Response to the example request without placeholders. Shows the message ID, parts including a plain text part and a URI part for 'unnamed-1.png', and the subject 'New deals!'. ```json { "data": { "attributes": { "messages": [ { "to": "17818434375", "message_id": "035273d3-c20d-47ee-9d4c-7b732d36fbe0" } ], "from": "18003004001", "parts": [ { "kind": "plain", "content_type": "text/plain", "transfer_encoding": "identity", "content_encoding": "identity" }, { "kind": "uri", "transfer_encoding": "identity", "content_encoding": "identity", "content_location": "unnamed-1.png" } ], "to": [ "17818434375" ], "inserted_at": "2026-03-20T19:53:33.795259", "subject": "New deals!", "headers": {}, "expires_at": null, "transaction_id": "e261793b-da9a-400f-9231-22e736af4d1c" }, "id": "e13b4f90-5a39-405d-a729-0f2b9bca9d60", "type": "mms-forward-res" } } ``` -------------------------------- ### Example variables for orderTollfreeNumbersMutation Source: https://docs.tsgglobal.com/api-reference/phone-numbers/toll-free-phone-numbers-search-and-ordering Example variables for the orderTollfreeNumbersMutation mutation, specifying the numbers to order and whether to enable SMS. ```json { "numbers": ["18886830411"], "smsEnable":true } ``` -------------------------------- ### SMS and MMS Configuration Response (GET /v5/dids/) Source: https://docs.tsgglobal.com/api-reference/phone-numbers/get-number-information Example 200 OK response for the SMS and MMS configuration endpoint. Shows possible values for each property, including number_type, sms_status, and ten_dlc_registered. Note that new properties may be added without notice. ```json { "number": "13603556404", "number_type": "long-code" | "short-code" | "toll-free", "mms_enabled": true | false, "mms_uri": "mm4://hooks.staging.tsgglobal.com", "sms_enabled": true | false, "campaign_id": null | "C12345", "compliance_status": "non_compliant" | "pending" | "compliant", "sms_status": "NONE" | "PENDING" | "ACTIVE" | "ERROR" | "DSBL-PND", "use_case_type": "" | "p2p" | "a2p", "nnid": "" | "12345" | null, "sms_post_ver": "smpp" | "postv1" | "postv2" | "post3jam", "sms_uri": null | "https://hooks.staging.tsgglobal.com", "x_api_key_header": null | "" | "abcd1234", "ten_dlc_registered": true | false, "tmobile_ten_dlc_registered": true | false } ``` -------------------------------- ### Additional Data Response (GET /v1/did/lookup) Source: https://docs.tsgglobal.com/api-reference/phone-numbers/get-number-information Example 200 OK response for the additional data lookup endpoint. Shows a CSV-like line with DID, routing info, activation date, rate center, state, SMS status, and other fields. ```text DID, ROUTING INFO, ACTIVATION DATE, LAST USED DATE, SEC USED, DID RATE, ORDER ID, RATE CENTER, STATE, TIER, PORTED, SMS ENABLED, SMS STATUS, SMS POST VERSION, SMS POST URL, PROVISIONING DATA, MAX CHANNELS "17867469428","SIP/XXXX","2022-01-11 00:00:00","2022-05-01 00:00:01","0","0.0030000000","CUS9079-SMS","MIAMI","FL","0","N","t","ACTIVE","postv1","","ppm-did-billing-RFC2833-no+","2000" ``` -------------------------------- ### Example response for GET /mms/templates/:id Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/get-single-mms-template Shows the JSON response returned by the GET /mms/templates/:id endpoint. It includes the template's name, parts (attachments), placeholders, body template, and subject template. ```json { "data": { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png", "headers": {}, "content_type": "image/png", "content_location": "unnamed-1.png" } ], "inserted_at": "2026-03-20T19:53:02.165449", "updated_at": "2026-03-20T19:53:02.165449", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "491aa990-1fbb-4058-8af0-c78049010d2f", "type": "mms-template" } } ``` -------------------------------- ### Example response for reservedList query Source: https://docs.tsgglobal.com/api-reference/phone-numbers/get-reserved-numbers-in-cart Example JSON response from the reservedList query, showing a list of reserved numbers with their city, lata, and telephoneNumber fields. ```json { "data": { "reservedList": { "numbers": [ { "city": "BOSTON", "lata": "128", "telephoneNumber": "8572391650" }, { "city": "BOSTON", "lata": "128", "telephoneNumber": "8572391651" } ] } } } ``` -------------------------------- ### Example response for searchPhoneNumbersQuery Source: https://docs.tsgglobal.com/api-reference/phone-numbers/toll-free-phone-numbers-search-and-ordering Example response from the searchPhoneNumbersQuery query, returning a list of toll-free numbers that match the search criteria. ```json { "data": { "tollfreeNumbers": { "numbers": [ "18886834580", "18886834690" ] } } } ``` -------------------------------- ### Example Response for OrderNumbers Mutation Source: https://docs.tsgglobal.com/api-reference/phone-numbers/checkout-numbers-in-cart Example JSON response showing the result of the numbersOrder mutation, including the order ID and purchased number details. ```json { "data": { "numbersOrder": { "items": [ { "tn": "8572391650", "tnNote": null, "trunkGroup": null } ], "orderId": 0 } } } ``` -------------------------------- ### MM4 SMTP Exchange Example Source: https://docs.tsgglobal.com/api-reference/programmable-mms/smtp Example SMTP/MM4 exchange showing the required command sequence: NOOP, EHLO, AUTH LOGIN, MAIL, RCPT, DATA, QUIT. All lines end with CRLF; arrows indicate server responses (>) and client input (<). AUTH must precede MAIL and RCPT, and DATA requires prior MAIL and RCPT. ```text # < NOOP > 250 OK < EHLO your_hostname > MM4 server babble < AUTH LOGIN > 334 VXNlcm5hbWU6 < base64-encoded-system-id > 334 UGFzc3dvcmQ6 < base64-encoded-api-key > 235 Authentication successful < MAIL FROM: > 250 Sender OK < RCPT TO: > 250 Recipient OK < DATA > 354 enter mail, end with line containing only '.' < your-mms-content-here < . > 250 queued as < QUIT > 221 BYE ``` -------------------------------- ### Fetch a message or message part - 200 response Source: https://docs.tsgglobal.com/openapi-specification Example response containing the message details. ```json { "id": "123e4567-e89b-12d3-a456-426614174000", "object": "sms", "type": "inbound", "from": "text", "to": "text", "body": "text", "encoding": 1, "status": "text", "delivery_receipt": null, "udh": { "ref_num": null, "count": null, "seq_num": null }, "parts": [ { "id": "123e4567-e89b-12d3-a456-426614174000" } ], "location": null, "inserted_at": "text", "updated_at": "text", "scheduled_at": null, "processed_at": null, "delivered_at": null, "expires_at": null } ``` -------------------------------- ### GET /mms/templates Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/list-mms-templates Lists every MMS template on the account. Returns all templates with their attributes. ```APIDOC ## GET /mms/templates ### Description Lists every MMS template on the account. ### Method GET ### Endpoint https://mmsc.tsgglobal.world/mms/templates ### Response #### Success Response (200) - **data** (array) - List of MMS templates. - **attributes** (object) - Template attributes. - **name** (string) - Template name. - **parts** (array) - List of template parts. - **metadata** (object) - Metadata for the part. - **uri** (string) - URI to the part content. - **headers** (object) - Headers for the part. - **content_type** (string) - MIME type of the part. - **content_location** (string) - File name of the part. - **inserted_at** (string) - Timestamp when the template was created. - **updated_at** (string) - Timestamp when the template was last updated. - **placeholders** (array of strings) - Placeholders used in the template. - **body_template** (string) - Body template with placeholders. - **subject_template** (string) - Subject template with placeholders. - **id** (string) - Unique identifier of the template. - **type** (string) - Type of the resource (e.g., "mms-template"). #### Response Example { "data": [ { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png", "headers": {}, "content_type": "image/png", "content_location": "unnamed-1.png" } ], "inserted_at": "2026-03-20T19:53:02.165449", "updated_at": "2026-03-20T19:53:02.165449", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "491aa990-1fbb-4058-8af0-c78049010d2f", "type": "mms-template" }, { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/185f821e-aac8-4296-88f4-035f155087f5/templates/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/185f821e-aac8-4296-88f4-035f155087f5/templates/2-unnamed-1.png", "headers": {}, "content_type": "image/png", "content_location": "unnamed-1.png" } ], "inserted_at": "2026-03-20T17:08:33.315490", "updated_at": "2026-03-20T17:08:33.315490", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "185f821e-aac8-4296-88f4-035f155087f5", "type": "mms-template" }, { "attributes": { "name": "visit-thank-you", "parts": [ { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/0a4cfbcc-533f-4a87-aed7-e49bdfc20025/templates/1-brochure.txt", "headers": {}, "content_type": "text/plain", "content_location": "brochure.txt" } ], "inserted_at": "2026-03-20T16:53:12.572326", "updated_at": "2026-03-20T16:53:12.572326", "placeholders": [ "name", "company" ], "body_template": "Dear {name}, welcome to {company}.", "subject_template": "Hello {name}" }, "id": "0a4cfbcc-533f-4a87-aed7-e49bdfc20025", "type": "mms-template" } ] } ``` -------------------------------- ### Example POST (VOIP) Source: https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-voice/add-destination-priority Curl command to add a VoIP destination priority. Requires a valid API key. Enter only the IP address of the gateway; the rest is formatted by TSG Global. ```bash curl -n https://api-service.tsgglobal.world/v1/did/priority -XPOST -H "Authorization: Bearer " \ -H "Content-Type: application/json" -d '{ "did": "12003004000", "destination": "192.168.1.1", "priority": 3, "call_type": "VOIP", "call_option": "NP" }' ``` -------------------------------- ### List Destination Priority CSV Response Source: https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-voice/list-destination-priority Example CSV response returned by the GET /v1/did/priority/lookup endpoint when the request succeeds (HTTP 200 OK). Each row lists a DID, its routing info, priority, and call type. ```csv DID,ROUTING INFO,PRIORITY,CALL TYPE 13603556939,SIP/+13603556939@SIP/13603556939@209.119.133.123,1,1 13603556939,SIP/13603556939@SIP/13603556939@209.119.133.123,2,1 13603556404,SIP/13603556404@8.30.173.27,1,1 13603556404,SIP/13603556404@8.36.70.27,2,1 ``` -------------------------------- ### Example request with placeholders Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/send-mms-using-template Sends an MMS using a template with placeholder values for 'name' and 'company'. The request body must include type 'mms-template-send-req', required 'from' and 'to' fields, and a 'params' object matching all template placeholders. ```json { "data": { "type": "mms-template-send-req", "attributes": { "from": "18003004001", "to": ["17818434375"], "params": { "name": "Jane", "company": "TSG" } } } } ``` -------------------------------- ### Sample arguments for VSF orders query Source: https://docs.tsgglobal.com/api-reference/compliance-and-identity/toll-free-verified-sender-order Example JSON object with optional arguments for the VSF orders query. All arguments are optional. ```json { "page": 1, "publicId": "VSF", "type": "verified_sender_form", "addedStartDate": "2022-01-01T12:00:00Z", "addedEndDate": "2022-12-01T12:00:00Z" } ``` -------------------------------- ### VS Code MCP configuration for TSG docs Source: https://docs.tsgglobal.com/ai-assistants-and-mcp Add to `.vscode/mcp.json` in your workspace and start the server from the MCP view. ```json { "servers": { "tsg-docs": { "type": "http", "url": "https://docs.tsgglobal.com/~gitbook/mcp" } } } ``` -------------------------------- ### Example Response for numbersReserve Source: https://docs.tsgglobal.com/api-reference/phone-numbers/add-number-to-cart Example response from the numbersReserve mutation showing reserved and excluded numbers with totals. ```json { "data": { "numbersReserve": { "excluded": [], "excludedTotal": 0, "requested": [ "8572391650", "8572391651" ], "requestedTotal": 2, "reserved": [ "8572391651", "8572391650" ], "reservedTotal": 2 } } } ``` -------------------------------- ### Example POST (PSTN) Source: https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-voice/add-destination-priority Curl command to add a PSTN destination priority. Requires a valid API key. The destination is entered in E.164 format without the leading plus. ```bash curl -n https://api-service.tsgglobal.world/v1/did/priority -XPOST -H "Authorization: Bearer " \ -H "Content-Type: application/json" -d '{ "did": "12003004000", "destination": "16352321233", "priority": 2, "call_type": "PSTN", "call_option": "NP" }' ``` -------------------------------- ### GET /v5/dids/{number} Source: https://docs.tsgglobal.com/openapi-specification Gets number configuration. This operation retrieves configuration details for a specific DID number. ```APIDOC ## GET /v5/dids/{number} ### Description Gets number configuration. ### Method GET ### Endpoint /v5/dids/{number} ``` -------------------------------- ### Sample Response for cdrRecords Source: https://docs.tsgglobal.com/api-reference/reports/cdr-records/get-cdr-records Example response from the cdrRecords query showing MessageCdr records with fields like charge, cost, datetime, direction, fromNumber, status, surcharge, toNumber, and uniqueId. Includes exportLink and paginationInfo with nextCursor null. ```json { "data": { "cdrRecords": { "cdrs": [ { "__typename": "MessageCdr", "account": "ACMEANCHO", "charge": "0.0095000000", "cost": "0.0051500000", "datetime": "2022-01-02T00:00:00Z", "direction": "SMS / MO Surcharge: T-Mobile - TF", "fromNumber": "12247512345", "status": "SENT", "surcharge": "0.0025000000", "toNumber": "18447312345", "uniqueId": "45e868c1-96b2-474c-a60f-98b76d812343" }, { "__typename": "MessageCdr", "account": "ACMEANCHO", "charge": "0.0010000000", "cost": "0.0000000000", "datetime": "2022-01-02T00:00:00Z", "direction": "SMS / MO: AT&T - LO-ZERO", "fromNumber": "18134512345", "status": "SENT", "surcharge": "0.0000000000", "toNumber": "19725212345", "uniqueId": "22854899-1bc9-47b2-9a90-98b76d812344" } ], "exportLink": "https://api.portal.tsgglobal.world/export/call_records?sig=abe5dfefb701b284db7b8d18e4673654e788ab42a1ef51bcbc4f153ga218f2fa&end_datetime=2022-01-10T23%3A59%3A59.999Z&fields=account%2Cunique_id%2Ccharge%2Cfrom_number%2Cto_number%2Cstatus%2Cdatetime%2Ccost%2Csurcharge%2Cdirection&start_datetime=2022-01-01T00%3A00%3A00.000Z&type=sms&company_internal_id=ACMEANCHO&new_export=true&user_id=e17bbdf0-e72a-4998-bcfb-8f3e92123456", "paginationInfo": { "limit": 100, "nextCursor": null } } } } ``` -------------------------------- ### Response with paginationInfo and nextCursor Source: https://docs.tsgglobal.com/api-reference/reports/cdr-records/get-cdr-records Example response showing paginationInfo with limit and nextCursor. The nextCursor value is used to fetch the next page. ```json { "data": { "cdrRecords": { "cdrs": ["...edited for readability..."], "exportLink": "...edited for readability...", "paginationInfo": { "limit": 2, "nextCursor": "123456" } } } } ``` -------------------------------- ### Disable MMS on a Number - Example Response Source: https://docs.tsgglobal.com/api-reference/phone-numbers/manage-number-for-mms/disable-mms-on-a-number Example JSON response showing the updated SMS/MMS configuration with mms_enabled set to false. ```json { "mms_enabled": false, "mms_uri": null, "number": "12342341234", "sms_enabled": true, "sms_uri": null } ``` -------------------------------- ### POST /mms/templates Source: https://docs.tsgglobal.com/openapi-specification Creates an MMS template. Placeholders use `{key}` where key matches `[a-zA-Z_][a-zA-Z0-9_]*`. The response lists the extracted placeholders. ```APIDOC ## POST /mms/templates ### Description Creates an MMS template. Placeholders use `{key}` where key matches `[a-zA-Z_][a-zA-Z0-9_]*`. The response lists the extracted placeholders. ### Method POST ### Endpoint https://sms.tsgglobal.world/mms/templates ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **data** (object) - Required - The request payload. - **type** (string) - Required - Must be `mms-template`. - **attributes** (object) - Required - Contains the template details. - **name** (string) - Required - The template name. - **body_template** (string) - Required - The body template with placeholders. - **subject_template** (string) - Optional - The subject template with placeholders. - **parts** (array of objects) - Optional - The MMS parts. Each part has: - **kind** (string) - Required - One of `plain`, `uri`, `data-uri`, or `embedded`. - **content_type** (string) - Optional - MIME type of the part. - **content_location** (string) - Optional - Content location identifier. - **content_encoding** (string) - Optional - Content encoding. - **transfer_encoding** (string) - Optional - Transfer encoding. - **body** (string) - Optional - For plain or embedded parts, the content body. - **uri** (string) - Optional - For URI parts, the public URI. - **headers** (object) - Optional - Additional headers. - **metadata** (object) - Optional - Additional metadata. ### Request Example ``` POST /mms/templates HTTP/1.1 Host: sms.tsgglobal.world Authorization: Bearer YOUR_SECRET_TOKEN Content-Type: application/json Accept: */* Content-Length: 324 { "data": { "type": "mms-template", "attributes": { "name": "text", "body_template": "text", "subject_template": "text", "parts": [ { "kind": "plain", "content_type": "text", "content_location": "text", "content_encoding": "text", "transfer_encoding": "text", "body": "text", "uri": "text", "headers": { "ANY_ADDITIONAL_PROPERTY": "text" }, "metadata": {} } ] } } } ``` ### Response #### Success Response (200) The created template. #### Response Example ``` { "data": { "id": "123e4567-e89b-12d3-a456-426614174000", "type": "mms-template", "attributes": { "name": "text", "body_template": "text", "subject_template": "text", "placeholders": [ "text" ], "parts": [ { "kind": "plain", "content_type": "text", "content_location": "text", "content_encoding": "text", "transfer_encoding": "text", "body": "text", "uri": "text", "headers": { "ANY_ADDITIONAL_PROPERTY": "text" }, "metadata": {} } ], "inserted_at": "text", "updated_at": "text" } } } ``` #### Error Responses - **401** - Missing or invalid API key. ``` -------------------------------- ### disconnectNumbers Mutation Example Source: https://docs.tsgglobal.com/api-reference/phone-numbers/disconnect-number Example GraphQL mutation to disconnect a number. The number must be within the 90-day holding requirement; otherwise, the disconnect will be delayed. ```graphql # if a number is 12345600000 mutation { disconnectNumbers(numbers: ["12345600000"]) { internalId orderId orderName requests { disconnectAt numbers requestId requestName requestNotes } } } ``` -------------------------------- ### Example response: single message Source: https://docs.tsgglobal.com/api-reference/programmable-sms/receive-an-sms-message Example JSON response for a single SMS message, showing fields like id, type, from, to, body, encoding, delivery_receipt, status, and timestamps. ```json { "id": "03b4641f-17a6-4565-bdba-1ce905be3312", "type": "outbound", "from": "12341234", "to": "12342341234", "object": "sms", "body": "hello", "encoding": 3, "delivery_receipt": "no", "status": "new", "location": null, "inserted_at": "2017-09-17T19:12:32.792699", "updated_at": "2017-09-17T19:12:32.792704", "scheduled_at": null, "processed_at": null, "delivered_at": null, "expires_at": null } ``` -------------------------------- ### Create MMS Template with Placeholders - Request Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/create-mms-template Example request body for creating an MMS template with placeholders. Includes a data URI attachment and a URL-referenced image. The body_template uses {placeholder} syntax. ```json { "data": { "type": "mms-template", "attributes": { "name": "visit-thank-you", "subject_template": "Hello {name}", "body_template": "Dear {name}, welcome to {company}.", "parts": [ { "kind": "data-uri", "content_location": "brochure.txt", "uri": "data:text/plain,Hello%20Brochure" }, { "kind": "uri", "content_location": "unnamed-1.png", "uri": "https://www.tsgglobal.com/wp-content/uploads/2025/01/unnamed-1.png" } ] } } } ``` -------------------------------- ### MMS Response Example Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message Example of a 200 OK response from the MMS API. The response contains a message_id per recipient, used in delivery reports. The request is accepted for processing, not necessarily sent or delivered. ```json { "data": { "id": "4e36a1f7-fd9c-4851-8087-918902fc204e", "type": "mms-forward-res", "attributes": { "inserted_at": "2019-10-24T00:48:53.312285Z", "transaction_id": "e7184cf1-1837-4318-a2cd-82c847830541", "from": "12003004005", "to": ["13746648333"], "subject": "Hello", "headers": {}, "messages": [{ "message_id": "9f3a72e9-7dc2-4741-96c7-ff2049b49b11", "to": "13746648333" }], "parts": [ { "id": "text-part@localhost", "content_type": "text/plain", "content_length": "11", "content_encoding": "identity", "transfer_encoding": "identity", "kind": "plain" } ] } } } ``` -------------------------------- ### Example MMS Webhook Response Payload Source: https://docs.tsgglobal.com/api-reference/programmable-mms/receive-an-mms-message Example JSON payload of an inbound MMS message delivered via webhook. The response should be acknowledged with a 2xx status (200 OK, 202 Accepted, or 204 No Content). ```json { "data": [ { "attributes": { "expires_at": null, "from": "14252437709", "headers": { "to": [ "+13462239287/TYPE=PLMN@mmsc.tsgglobal.world" ] }, "inserted_at": "2022-04-06T21:50:06.316116", "metadata": {}, "parts": [ { "body": null, "content_encoding": "identity", "content_length": null, "content_location": "476CC8E7CD30DBE0..unk", "content_type": "application/smil", "decoded": false, "headers": {}, "id": "7a1ebff0-a8b7-4a24-b951-85b04ac6855a", "kind": "uri", "metadata": {}, "transfer_encoding": "identity", "uri": "https://content.mms.smshub.world/prod/7160ce4c-0205-4e47-9eb7-3954991911c2/parts/476CC8E7CD30DBE0..unk" }, { "body": null, "content_encoding": "identity", "content_length": null, "content_location": "image0000.JPG", "content_type": "image/jpeg", "decoded": false, "headers": {}, "id": "7c2459ec-95b9-454d-8d9a-0293442b6459", "kind": "uri", "metadata": {}, "transfer_encoding": "identity", "uri": "https://content.mms.smshub.world/prod/7160ce4c-0205-4e47-9eb7-3954991911c2/parts/photo.JPG" } ], "pool_name": null, "request_delivery_reports": false, "subject": "", "to": [ "13462239287" ], "transaction_id": "74def178-695b-4f04-9acd-efb3b0e7dab9", "version": "2020-01-14" }, "id": "61d55de8-8ccd-4bf3-8b51-848a8c21919b", "type": "mms-forward-req" } ] } ``` -------------------------------- ### Preview MMS template with placeholders - request and response Source: https://docs.tsgglobal.com/api-reference/programmable-mms/send-an-mms-message-using-templates/preview-mms-template Request and response for previewing an MMS template with placeholders. The request must include a `params` object matching all placeholders defined in the template. The response shows the rendered parts, including a plain text body and URI attachments. ```json { "data": { "type": "mms-template-preview-req", "attributes": { "from": "18003004001", "to": ["17818434375"], "params": { "name": "Jane", "company": "TSG" } } } } ``` ```json { "data": { "attributes": { "metadata": {}, "from": "18003004001", "parts": [ { "metadata": {}, "uri": null, "body": "Dear Jane, welcome to TSG.", "kind": "plain", "headers": {}, "content_type": "text/plain", "content_location": null }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/1-brochure.txt", "body": null, "kind": "uri", "headers": {}, "content_type": null, "content_location": "brochure.txt" }, { "metadata": {}, "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png", "body": null, "kind": "uri", "headers": {}, "content_type": null, "content_location": "unnamed-1.png" } ], "to": [ "17818434375" ], "subject": "Hello Jane", "request_delivery_reports": false }, "id": "f67481a0-a532-4dda-b931-6973ce292558", "type": "mms-forward-req" } } ``` -------------------------------- ### Example DLR JSON object Source: https://docs.tsgglobal.com/api-reference/programmable-sms/delivery-receipts-dlrs Shows the structure of a delivery receipt (DLR) delivered to your inbound webhook. The example includes fields such as delivery_error_code, delivery_status, done_at, from, id, inserted_at, object, sms, submitted_at, to, type, and updated_at. ```json { "delivery_error_code": "000", "delivery_status": "delivered", "done_at": "2022-04-13T21:35:00", "from": "14252437709", "id": "a2692312-2050-4a50-9123-ca7b4cde0db7", "inserted_at": "2022-04-13T21:35:22.401373", "object": "sms_dlr", "sms": { "id": "a4c56a01-4daf-4ae1-9732-025b427add13" }, "submitted_at": "2022-04-13T21:35:00", "to": "18574914340", "type": "inbound", "updated_at": "2022-04-13T21:35:22.401373" } ```