---
notionId: "bff0ba0259754166818f502aa4df8f93"
product: "developer"
cluster: "business-sms"
intent: "developer.virtualtext-api"
docSlug: "virtualtext-api"
task: "VirtualText in the API"
title: "VirtualText in the API | VirtualPBX"
meta_description: "The VirtualText API connects an external platform to business texting. Authenticate with the authorization header, then send an SMS or MMS and receive messages"
answer: "The VirtualText API connects an external platform to business texting. Authenticate with the authorization header, then send an SMS or MMS and receive messages through a webhook. The webhook event carries the inbound message, and a send request delivers an outbound message to a number on the account. Use this API when another system should read or write those texts instead of the inbox alone."
audience: "user"
updated: "2025-10-24"
legacy: []
headings: [{"depth":2,"text":"About VirtualText API","id":"about-virtualtext-api"},{"depth":3,"text":"Authentication","id":"authentication"},{"depth":3,"text":"Authorization Header","id":"authorization-header"},{"depth":3,"text":"Receiving SMS and MMS","id":"receiving-sms-and-mms"},{"depth":3,"text":"Webhook Event Data","id":"webhook-event-data"},{"depth":3,"text":"Sending SMS and MMS","id":"sending-sms-and-mms"},{"depth":3,"text":"API","id":"api"},{"depth":3,"text":"Headers","id":"headers"},{"depth":3,"text":"Arguments","id":"arguments"},{"depth":3,"text":"Example Request Body:","id":"example-request-body"},{"depth":3,"text":"Example Response Body:","id":"example-response-body"},{"depth":3,"text":"Success - HTTP 200","id":"success---http-200"},{"depth":3,"text":"Failure - HTTP 400","id":"failure---http-400"},{"depth":3,"text":"Create Contact","id":"create-contact"},{"depth":3,"text":"API","id":"api-1"},{"depth":3,"text":"Headers","id":"headers-1"},{"depth":3,"text":"Arguments","id":"arguments-1"},{"depth":3,"text":"Example Request Body:","id":"example-request-body-1"},{"depth":3,"text":"Example Response Body:","id":"example-response-body-1"},{"depth":3,"text":"Success - HTTP 200","id":"success---http-200-1"},{"depth":3,"text":"Failure - HTTP 400","id":"failure---http-400-1"},{"depth":3,"text":"Update Contact","id":"update-contact"},{"depth":3,"text":"Headers","id":"headers-2"},{"depth":3,"text":"Arguments","id":"arguments-2"},{"depth":3,"text":"Example Request Body:","id":"example-request-body-2"},{"depth":3,"text":"Example Response Body:","id":"example-response-body-2"},{"depth":3,"text":"Success - HTTP 200","id":"success---http-200-2"},{"depth":3,"text":"Failure - HTTP 400","id":"failure---http-400-2"},{"depth":3,"text":"Get Contact","id":"get-contact"},{"depth":3,"text":"Headers","id":"headers-3"},{"depth":3,"text":"Example Response Body:","id":"example-response-body-3"},{"depth":3,"text":"Success - HTTP 200","id":"success---http-200-3"},{"depth":3,"text":"Failure - HTTP 400","id":"failure---http-400-3"},{"depth":3,"text":"Get Contact List","id":"get-contact-list"},{"depth":3,"text":"Headers","id":"headers-4"},{"depth":3,"text":"Example Response Body:","id":"example-response-body-4"},{"depth":3,"text":"Success - HTTP 200","id":"success---http-200-4"},{"depth":3,"text":"Failure - HTTP 400","id":"failure---http-400-4"}]
lint: []
---

## About VirtualText API

VirtualText API is intended for integrating external platforms and business tools.

Our API allows you to send outbound SMS and MMS messages, list, create and update contacts as well as list. Please read the documentation below for implementing the API.

<aside class="note"><p>Outbound Marketing Use is not supported on this API. Any outbound marketing messages sent via API may result in termination of your API access.</p></aside>

<aside class="note"><p>VirtualText Pro support marketing using Drip Campaigns and Campaigns to contact lists. Please contact our team to learn more.</p></aside>

### Authentication

### Authorization Header

All API requests require an Authorization header that includes a valid Bearer token composed of an Account User ID and Access Token.

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr></table></div>

<img src="/assets/virtualtext-api/api_authorization.png" width="1622" height="1338" alt="Authorization Header" loading="lazy" decoding="async">

### Receiving SMS and MMS

Relay is a feature that enables the synchronization of messages that are sent or received to a user's phone number with external systems like CRMs, Support Desk software, and more.

In VirtualText under Integrations, a webhook can be configure to relay all SMS and MMS messages received by a user to external systems.

### Webhook Event Data

Relay sends a POST to the Relay Webhook URL when a message is sent or received. The POST body is formatted as such:

<pre tabindex="0"><code class="language-json">{
	MessageID: 'abc123xyz', // the unique message ID
	ConversationID: &quot;xyz321cba&quot;, //the unique contact ID
	ToNumber: &quot;+15555555555&quot;, //the number the message was sent to
	FromNumber: &quot;+13333333333&quot;, //the number the message was sent from
	MessageBody: &quot;Hello, world!&quot;, //the message body
	MessageDirection: &quot;in&quot;, //the message direction (either &quot;in&quot; or &quot;out&quot;)
	TextableUserID: &quot;lmnopqrstuv&quot;, //the user id of the account that sent or received the message,
	ContactName: &quot;John Doe&quot;, //the Full Name property of the contact,
	ContactEmail: &quot;john.doe@gmail.com&quot;, //the e-mail address of the contact (if available),
	Media: [&quot;https://sampleUrl.com/URL1&quot;,&quot;https://sampleUrl.com/URL2&quot;], //all MMS attachment urls associated with the message (if any)
}</code></pre>

### Sending SMS and MMS

You may send individual SMS and/or MMS message using this API endpoint.

### API

POST https://public-api.virtualtext.com/api/send

### Headers

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr><tr><td>Content-type</td><td>application/json</td></tr></table></div>

### Arguments

<div class="table-scroll" tabindex="0"><table><tr><th>Name</th><th>Type</th><th>Description</th></tr><tr><td>to</td><td>String</td><td>This should be an e.164 formatted phone number (e.g. +15555555555).</td></tr><tr><td>from</td><td>String</td><td>This should the e.164 formatted phone number assigned to the user (e.g. +15555555555).</td></tr><tr><td>message</td><td>String</td><td>This is the message body as a string.</td></tr><tr><td>media</td><td>Array</td><td>(Optional) This should be an array of media files as publicly available URLs.</td></tr><tr><td>sendStatus</td><td>String</td><td>(Optional) Set to &quot;sent&quot;. This is useful if you interact directly with your carrier API's but want to store the message in the conversation history. When set, we will NOT send this through the carrier APIs and assume that you already have.</td></tr></table></div>

### Example Request Body:

<pre tabindex="0"><code>{
&quot;to&quot;:&quot;+15555555555&quot;
&quot;from&quot;:+14444444444
&quot;message&quot;: &quot;Hello, world!&quot;,
&quot;media&quot;: [
&quot;https://picsum.photos/200/300&quot; ]
}</code></pre>

### Example Response Body:

### Success - HTTP 200

<pre tabindex="0"><code>{
&quot;status&quot;: &quot;true&quot;
}</code></pre>

### Failure - HTTP 400

<pre tabindex="0"><code>{
&quot;errors&quot;:['Missing parameter '[fieldName]' (e.g. accountUid, accessToken, etc.).', ]
}</code></pre>

### Create Contact

Creates an contact in VirtualText for the authenticated user.

### API

POST https://virtualtext-txb.textable.app/api/contacts

### Headers

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr><tr><td>Content-type</td><td>application/json</td></tr></table></div>

### Arguments

<div class="table-scroll" tabindex="0"><table><tr><th>Name</th><th>Type</th><th>Description</th></tr><tr><td>phoneNumber</td><td>String</td><td>Required. This should be an e.164 formatted phone number (e.g. +15555555555).</td></tr><tr><td>fullName</td><td>String</td><td>(Optional) If not set, fullName will be set to the phoneNumber value.</td></tr><tr><td>email</td><td>String</td><td>(Optional)</td></tr></table></div>

### Example Request Body:

<pre tabindex="0"><code>{
&quot;phoneNumber&quot;:&quot;+15554442222&quot;,
&quot;fullName&quot;:&quot;John Doe&quot;,
&quot;email&quot;: &quot;john.doe@gmail.com&quot;
}</code></pre>

### Example Response Body:

### Success - HTTP 200

<pre tabindex="0"><code>{
&quot;id&quot;: &quot;xyzabc123&quot;
&quot;fullName&quot;: &quot;John Doe&quot;
&quot;phoneNumber&quot;: &quot;+15554442222&quot;
&quot;email&quot;: &quot;john.doe@gmail.com&quot;
}</code></pre>

### Failure - HTTP 400

<pre tabindex="0"><code>{
&quot;errors&quot;:['Missing parameter '[fieldName]' (e.g. accountUid, accessToken, etc.).', ]
}</code></pre>

### Update Contact

Updates a contact.

POST https://public-api.virtualtext.com/api/contacts/\{id\}

### Headers

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr><tr><td>Content-type</td><td>application/json</td></tr></table></div>

### Arguments

<div class="table-scroll" tabindex="0"><table><tr><th>Name</th><th>Type</th><th>Description</th></tr><tr><td>phoneNumber</td><td>String</td><td>Required. This should be an e.164 formatted phone number (e.g. +15555555555).</td></tr><tr><td>fullName</td><td>String</td><td>(Optional) If not set, fullName will be set to the phoneNumber value.</td></tr><tr><td>email</td><td>String</td><td>(Optional)</td></tr></table></div>

### Example Request Body:

<pre tabindex="0"><code>{
&quot;phoneNumber&quot;:&quot;+15554442222&quot;,
&quot;fullName&quot;:&quot;John Doe&quot;,
&quot;email&quot;: &quot;john.doe@gmail.com&quot;
}</code></pre>

### Example Response Body:

### Success - HTTP 200

<pre tabindex="0"><code>{
&quot;id&quot;: &quot;xyzabc123&quot;
&quot;fullName&quot;: &quot;John Doe&quot;
&quot;phoneNumber&quot;: &quot;+15554442222&quot;
&quot;email&quot;: &quot;john.doe@gmail.com&quot;
}</code></pre>

### Failure - HTTP 400

<pre tabindex="0"><code>{
&quot;errors&quot;:['Missing parameter '[fieldName]' (e.g. accountUid, accessToken, etc.).', ]
}</code></pre>

### Get Contact

Get a contact.

GET https://public-api.virtualtext.com/api/contacts/\{id\}

### Headers

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr><tr><td>Content-type</td><td>application/json</td></tr></table></div>

### Example Response Body:

### Success - HTTP 200

<pre tabindex="0"><code>{
&quot;id&quot;: &quot;xyzabc123&quot;
&quot;fullName&quot;: &quot;John Doe&quot;
&quot;phoneNumber&quot;: &quot;+15554442222&quot;
&quot;email&quot;: &quot;john.doe@gmail.com&quot;
}</code></pre>

### Failure - HTTP 400

<pre tabindex="0"><code>{
&quot;errors&quot;:['Missing parameter '[fieldName]' (e.g. accountUid, accessToken, etc.).', ]
}</code></pre>

### Get Contact List

Gets a list of contact contact for the authenticated user.

GET https://public-api.virtualtext.com/api/contacts

### Headers

<div class="table-scroll" tabindex="0"><table><tr><th>Type</th><th>Value</th></tr><tr><td>Authorization</td><td><code>Bearer accountUid:accessToken</code></td></tr><tr><td>Content-type</td><td>application/json</td></tr></table></div>

### Example Response Body:

### Success - HTTP 200

<pre tabindex="0"><code>{
    &quot;contacts&quot;:[
    {
        &quot;id&quot;: &quot;xyzabc123&quot;
        &quot;fullName&quot;: &quot;John Doe&quot;
        &quot;phoneNumber&quot;: &quot;+15554442222&quot;
        &quot;email&quot;: &quot;john.doe@gmail.com&quot;
    },
    ...
    ]
}</code></pre>

### Failure - HTTP 400

<pre tabindex="0"><code>{
&quot;errors&quot;:['Missing parameter '[fieldName]' (e.g. accountUid, accessToken, etc.).', ]
}</code></pre>

← Previous

[Webhooks](/a8bfbe0c04ad4993a231488e3dd2f0f2)

Next →

[Zapier](/1193eca25e684f8191145a9f0f2bcdd3)
