Thousands of businesses rely on SimpleTexting to communicate with their audience via text message. With our API, developers can access many of our platform’s features and integrate them with other websites or applications. This document details the available SimpleTexting API functions and their parameters. For additional security, our API is by approval only. If you’d like access, sign up for a trial account and email [email protected] with details about your use case.
How it works
Our API is organized around REST. It uses standard HTTP response codes and authentication. Before you get started, there a few things to keep in mind:
content-type is application/json.Accept request header or set it to application/json.Each time you make a request to our API, we use a bearer token in your header to authenticate your account. API requests without authentication will fail. Your API token can be found under settings.
Please be sure to keep your bearer token secure. Don’t share it any public areas such as GitHub, client-side code, etc.
Bearer authentication (also called token authentication) is an authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the Authorization: Bearer <token> header when making requests to protected resources. To understand more about bearer tokens, please take a look at the following resource.
| Security Scheme Type | API Key |
|---|---|
| Header parameter name: | Authorization |
Send and manage campaigns directly from the SimpleTexting API. The endpoint allows you to Create and Send a campaign, get a specific campaign by its name or ID, or list all of your SimpleTexting campaigns.
Note: If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.
Get all immediate campaigns from the SimpleTexting system. Please note that none of your scheduled or recurring campaigns will be returned by this request.
Example: We request all SENT campaigns sent from the 8005551234 number to the list My First List:
https://api-app2.simpletexting.com/v2/api/campaigns?page=100&size=2&accountPhone=8005551234&state=SENT&listNameOrId=My First List&startDateFrom=2021-04-28T23:20:08.489Z&startDateTo=2021-05-28T23:20:08.489Z
| page | integer <int32> >= 0 Default: 0 Example: page=100 An ordinal number of the page to return with the results of a request (with the campaigns sent from the given number). Please note that page numbering starts at zero ( |
| size | integer <int32> <= 500 Default: 50 Example: size=2 The number of the returned campaigns to show per page |
| accountPhone | string Example: accountPhone=8005551234 The phone number the campaign was sent from |
| state | string Enum: "PAUSED" "SENDING" "COMPLETED" "ERROR" "MONITORING" Example: state=SENDING The current state of the immediate campaigns you wish to retrieve:
|
| listNameOrId | string Example: listNameOrId=My First List The list name or list ID |
| startDateFrom | string <date-time> Example: startDateFrom=2021-04-28T23:20:08.489Z List campaigns starting from a certain date. The time is in ISO 8601 format. |
| startDateTo | string <date-time> Example: startDateTo=2021-05-28T23:20:08.489Z List campaigns up to a certain date. The time is in ISO 8601 format. |
{- "content": [
- {
- "campaignId": "607f0558a7c898629dd47d7a",
- "title": "My first campaign",
- "accountPhone": "8005551234",
- "customFieldsMaxLength": {
- "firstname": "20"
}, - "state": "COMPLETED",
- "lists": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "My First List"
}
], - "segments": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "My First List"
}
], - "created": "2021-04-28T23:20:08.489Z",
- "modified": "2021-04-28T23:20:08.489Z",
- "started": "2021-04-28T23:20:08.489Z",
- "finished": "2021-04-28T23:20:08.489Z",
- "messageTemplate": {
- "category": "MMS",
- "subject": "Some message from SimpleTexting",
- "text": "Hello! How are you?",
- "fallbackText": "We sent you a message!",
}, - "origin": "API_V2",
- "outcome": {
- "successRate": 100,
- "optOutRate": 0,
- "totalSent": 1000,
- "creditsTotal": 1000
}, - "trackingLinks": {
- "url": "www.simpletexting.net",
- "clickCount": 550
}
}
], - "totalPages": 0,
- "totalElements": 0
}Create and send a campaign.
Example: Here we created a campaign from our short code 8005551234 and sent it to a segment identified here by its ID, along with a list called My First List. We also specified that the First Name custom field will only take up 20 characters. Finally, we specified that 2 pieces of media will be attached. One is housed on SimpleTexting and identified by its ID, the other is getting pulled from an external link:
{ "title": "My first campaign", "listsOrSegments": [ "507f191e810c19729de860ea", "My First List" ], "accountPhone": "8005551234", "customFieldsMaxLength": { "firstName": 20 }, "messageTemplate": { "title": "My first campaign", "subject": "My first campaign", "text": "Hi %%firstname%%, welcome to our campaign!", "fallbackText": "My first campaign", "mediaItems": [ "https://txt.so/img.jpg", "507f1f77bcf86cd799439011" ] } }
| title required | string [ 1 .. 250 ] characters Campaign title Example: |
| listIds | Array of strings Lists IDs or names Example: |
| segmentIds | Array of strings Segments IDs or names Example: |
| accountPhone | string Account phone, primary number is default Example: |
object Custom fields length in current campaign, overwrite default settings. See /custom-fields Example: | |
required | object (MessageTemplate) Campaign Template Example: |
{- "title": "My first campaign",
- "listIds": [
- "507f191e810c19729de860ea",
- "My First List"
], - "segmentIds": [
- "507f191e810c19729de860ea",
- "My First List"
], - "accountPhone": "8005551234",
- "customFieldsMaxLength": {
- "firstname": "20"
}, - "messageTemplate": {
- "mode": "MMS_PREFERRED",
- "subject": "My first campaign",
- "text": "Hi %%firstname%%, welcome to our campaign!",
- "unsubscribeText": "If you no longer wish to hear from us, reply STOP",
- "fallbackText": "My first campaign",
- "fallbackUnsubscribeText": "If you no longer wish to hear from us, reply STOP",
}
}{- "id": "507f191e810c19729de860ea"
}Get a campaign via its unique ID.
Example: Below, we return the information associated with the campaign whose ID is 507f1f77bcf86cd799439011. You can use the Get all Campaigns endpoint to retrieve campaign IDs for all of your campaigns:
https://api-app2.simpletexting.com/v2/api/507f1f77bcf86cd799439011
| campaignId required | string Example: 507f1f77bcf86cd799439011 Campaign ID in hexadecimal format |
{- "campaignId": "607f0558a7c898629dd47d7a",
- "title": "My first campaign",
- "accountPhone": "8005551234",
- "customFieldsMaxLength": {
- "firstname": "20"
}, - "state": "COMPLETED",
- "lists": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "My First List"
}
], - "segments": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "My First List"
}
], - "created": "2021-04-28T23:20:08.489Z",
- "modified": "2021-04-28T23:20:08.489Z",
- "started": "2021-04-28T23:20:08.489Z",
- "finished": "2021-04-28T23:20:08.489Z",
- "messageTemplate": {
- "category": "MMS",
- "subject": "Some message from SimpleTexting",
- "text": "Hello! How are you?",
- "fallbackText": "We sent you a message!",
}, - "origin": "API_V2",
- "outcome": {
- "successRate": 100,
- "optOutRate": 0,
- "totalSent": 1000,
- "creditsTotal": 1000
}, - "trackingLinks": {
- "url": "www.simpletexting.net",
- "clickCount": 550
}
}In SimpleTexting, users can send and receive messages. With our API, this can be done programmatically.
Note: If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.
Retrieves a list of all messages sent to a specific contact from a specific number on your account.
Example: Here we return all messages from an account:
https://api-app2.simpletexting.com/v2/api/messages?page=100&size=500
| page | integer <int32> >= 0 Default: 0 Example: page=25 An ordinal number of the page to return with the results of a request (with the messages of the given number). Please note that page numbering starts at zero ( |
| size | integer <int32> <= 500 Default: 50 Example: size=50 The number of the returned messages to show per page |
| accountPhone | string Example: accountPhone=8005551234 The phone number on your account the messages were sent to. If blank, the request will return the messages sent to the primary account phone |
| since | string <date-time> Example: since=2021-04-28T23:20:08.489Z First sent/received timestamp. The time is in ISO 8601 format. |
| contactPhone | string Example: contactPhone=8001234567 The contact's phone number |
{- "content": [
- {
- "id": "507f191e810c19729de860ea",
- "subject": "Some message from SimpleTexting",
- "text": "Hello! How are you?",
- "contactPhone": "8001234567",
- "accountPhone": "8005551234",
- "directionType": "MO",
- "timestamp": "2020-04-28T23:20:08.489Z",
- "referenceType": "API_SEND",
- "category": "SMS",
- "mediaItems": [
- "507f1f77bcf86cd799439011",
- "507f1f77bcf86cd799439333"
]
}
], - "totalPages": 0,
- "totalElements": 0
}Send either an MMS or SMS message to a contact. Use this programmatically to send to multiple contacts.
If the message contains a link from a common third-party link shortener such as bit.ly, it will appear from our URL shortener instead and occupy 20 characters. Learn more.
There are limitations on Media Files with MMS messages. The size limitations of these items are discussed here.
Example: Below, we have an example of an MMS message being sent. We specified that we wanted to send an MMS message to 1234567 from one of the numbers on our account - 8005551234. We also provided some fallback text, should the receiving cell phone be unable to receive an MMS, and provided a link/ID to the media we wished to attach:
{ "contactPhone": "1234567890", "accountPhone": "8005551234", "mode": "MMS_PREFERRED", "text": "Hello! How are you?", "subject": "Some message from SimpleTexting", "fallbackText": "[url=%%fallback_link%%]", "mediaItems": [ "https://txt.so/img.jpg", "507f1f77bcf86cd799439011" ] }
| contactPhone required | string Contact's phone Example: |
| accountPhone | string The account phone to send from. If this field is left blank, the primary account number will be used as a default Example: |
| mode required | string Enum: "AUTO" "SINGLE_SMS_STRICTLY" "MMS_PREFERRED" Determines how your message will be presented:
Example:
|
| subject | string MMS Subject (available for MMS) Example: |
| text required | string Text Body Example: |
| fallbackText | string Custom fallback text if MMS cannot be received. Should contain '[url=%%fallback_link%%]' placeholder that will be replaced with a link to the message Example: |
| mediaItems | Array of strings List of MMS media URLs for temporal storing or media items IDs Example: |
{- "contactPhone": "1234567890",
- "accountPhone": "8005551234",
- "mode": "MMS_PREFERRED",
- "subject": "Some message from SimpleTexting",
- "text": "Hello! How are you?",
- "fallbackText": "[url=%%fallback_link%%]",
}{- "id": "507f191e810c19729de860ea",
- "credits": 0
}Evaluate the body of your message before sending it to a contact or contacts.
Example: We evaluate a message to determine a number of properties. These include the number of credits it will use, whether it is an extended SMS or a regular SMS and any potential errors that may occur:
https://api-app2.simpletexting.com/v2/api/messages/evaluate
| mode required | string Enum: "AUTO" "SINGLE_SMS_STRICTLY" "MMS_PREFERRED" Determines how your message will be presented:
Example:
Example: |
| subject | string MMS Subject (available for MMS) Example: |
| text required | string Text Body Example: |
| fallbackText | string A custom fallback text if a contact can't receive an MMS message. It should contain a Example: |
| mediaItems | Array of strings List of MMS media URLs for temporal storing or media items IDs Example: |
{- "mode": "MMS_PREFERRED",
- "subject": "New In Store",
- "text": "Hello! How are you?",
- "fallbackText": "[url=%%fallback_link%%]",
}{- "detectedCategory": "SMS",
- "length": 134,
- "remains": 23,
- "maxLength": 150,
- "unicode": true,
- "sumOfCredits": 1,
- "warnings": "Text is blank",
- "errors": [
- "Invalid phone number"
]
}Retrieve a specific message from the system via its message ID.
Example: Below, we return the information associated with the message whose ID is 507f1f77bcf86cd799439011. You can use the Get all Messages endpoint to retrieve message IDs for all of your messages:
https://api-app2.simpletexting.com/v2/api/messages/507f1f77bcf86cd799439011
| messageId required | string Example: 507f1f77bcf86cd799439011 Message ID in hexadecimal format |
{- "id": "507f191e810c19729de860ea",
- "subject": "Some message from SimpleTexting",
- "text": "Hello! How are you?",
- "contactPhone": "8001234567",
- "accountPhone": "8005551234",
- "directionType": "MO",
- "timestamp": "2020-04-28T23:20:08.489Z",
- "referenceType": "API_SEND",
- "category": "SMS",
- "mediaItems": [
- "507f1f77bcf86cd799439011",
- "507f1f77bcf86cd799439333"
]
}When sending messages via the SimpleTexting platform, you may need to attach various media items. This API allows you to perform various operations needed to manage your media attachments. The size limitations of these items are discussed here.
Upload a media file from a local directory to SimpleTexting.
Example: Here we upload an image from our local directory using an HTTP request. We state that the media should be shared with teammates:
POST /api/mediaitems/upload?shared=true HTTP/1.1 Host: https://api-app2.simpletexting.com/v2/ accept: */* Authorization: Bearer {{YOUR_TOKEN}} Content-Length: 176 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBound
| shared | boolean Default: true Define whether a media file is shared with teammates |
| file required | string <binary> The media file you want to upload |
{- "id": "607f0558a7c898629dd47d7a",
- "createdDate": "2021-04-28T23:20:08.489Z",
- "name": "myfile.jpg",
- "gallery": "mms",
- "size": 10,
- "status": "PROCESSED",
- "contentType": "image/png",
- "ext": "png",
- "canDelete": true
}This endpoint allows you to upload media via a URL so that you can send it in a message to a contact.
Example: Below we upload some media via a hosted URL to the SimpleTexting system:
{ "link": "https://dropbox.com/uploads/2019/08/7kAnVTq5Pb9TxEJbBNMDwh-768-80-1.jpg" }
| shared | boolean Default: true Define whether a media file is shared with teammates |
| link required | string The URL you will upload your media to Example: |
{- "id": "607f0558a7c898629dd47d7a",
- "createdDate": "2021-04-28T23:20:08.489Z",
- "name": "myfile.jpg",
- "gallery": "mms",
- "size": 10,
- "status": "PROCESSED",
- "contentType": "image/png",
- "ext": "png",
- "canDelete": true
}This endpoint allows you to retrieve all Media Items.
Example: Here we return all Media Items from an account:
https://api-app2.simpletexting.com/v2/api/mediaitems?page=100&size=500
| page | integer <int32> >= 0 Default: 0 Example: page=29 Number of pages |
| size | integer <int32> <= 500 Default: 50 Example: size=50 Page size |
{- "content": [
- {
- "id": "607f0558a7c898629dd47d7a",
- "createdDate": "2021-04-28T23:20:08.489Z",
- "name": "myfile.jpg",
- "gallery": "mms",
- "size": 10,
- "status": "PROCESSED",
- "contentType": "image/png",
- "ext": "png",
- "canDelete": true
}
], - "totalPages": 0,
- "totalElements": 0
}| mediaItemId required | string Example: 507f1f77bcf86cd799439011 Media item ID in hexadecimal format |
{- "id": "607f0558a7c898629dd47d7a",
- "createdDate": "2021-04-28T23:20:08.489Z",
- "name": "myfile.jpg",
- "gallery": "mms",
- "size": 10,
- "status": "PROCESSED",
- "contentType": "image/png",
- "ext": "png",
- "canDelete": true
}Remove media that you have previously uploaded to SimpleTexting.
Example: Here we delete a Media Item whose ID is507f1f77bcf86cd799439011. You can use the Get all Media Items endpoint to retrieve Media Items IDs for all of your Media Items:
https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011
| mediaItemId required | string Example: 507f1f77bcf86cd799439011 The mediaItemId in hexadecimal format |
We can accept a wide variety of file types over MMS. The industry standard maximum file
size limit is 600KB for toll-free accounts and is 1MB on shortcode accounts.
We support the following file type: MPEG Audio, MPEG Video, MP4 Video, VCARDs, PDF
For popular image types we can accept media up to 15MB, our system will automatically
compress these to the 600KB industry limitation. These media types include: JPEG, PNG, GIF
At a minimum, each contact in SimpleTexting must have a phone number. Contacts can also hold additional information including first name, last name, and email address. You can also create custom fields to store data specific to your website or app’s needs.
Get a contact via their unique ID or phone number. Phone number is the preferred parameter for this call.
Example: Below, we return the information associated with the Contact whose ID is 507f1f77bcf86cd799439011. You can use the Get all Contacts endpoint to retrieve contact IDs for all of your contacts:
https://api-app2.simpletexting.com/v2/api/contacts/507f1f77bcf86cd799439011
| contactIdOrNumber required | string Example: 3051234567 Phone number (preferred) or Contact ID in hexadecimal format Example: |
{- "contactId": "607f0558a7c898629dd47d7a",
- "contactPhone": "1234567890",
- "firstName": "John",
- "lastName": "Doe",
- "birthday": "1985-05-15",
- "lists": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "list name"
}
], - "customFields": {
- "zipcode": "12345"
}, - "comment": "VIP client",
- "subscriptionStatus": "OPT_IN",
- "created": "2021-04-28T23:20:08.489Z",
- "updated": "2021-05-28T20:20:08.489Z",
- "updateSource": "IMPORTED_FROM_FILE"
}Update a contact’s phone number or any other field.
Example: Below we update our contact, 3051234567. We declared their custom field value for zipcode is 12345 and that they get added to the list with an ID 507f191e810c19729de860ea and another list called My First List. In our URL, we requested that the contact gets added to a new list while remaining on the current one. We also requested not to update the contact's information if they already exist within the system:
URL:
https://api-app2.simpletexting.com/v2/api/contacts/3051234567?listsReplacement=false&false
Request Body:
{ "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] }
| contactIdOrNumber required | string Example: 3051234567 Contact ID in hexadecimal format or the contact's phone number. Example: |
| upsert | boolean Default: true If a contact already exists with the phone number in your request body, the contact will be updated with the information in the request when upsert is set to true. Example: |
| listsReplacement | boolean Default: true If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list. Example: |
| contactPhone | string Contact's phone number Example: |
| firstName | string Contact's first name Example: |
| lastName | string Contact's last name Example: |
string Contact's email Example: | |
| birthday | string Contact's birthday in format: yyyy-mm-dd Example: |
object (Key/value pairs) Object that contains custom field values, where you should use a Name or a Merge tag in a property name and a field value as a property value. To find a merge tag, please see the Contacts > Custom Fields section for your account. For example: if you have a custom field with the name Street address and the merge tag | |
| comment | string Notes about the contact. Example: |
| listIds | Array of strings All the lists (List IDs or names) to add the contact to or replace. Example: |
{- "contactPhone": "1234567890",
- "firstName": "John",
- "lastName": "Doe",
- "birthday": "1985-05-15",
- "customFields": {
- "zipcode": "12345"
}, - "comment": "VIP client",
- "listIds": [
- "507f191e810c19729de860ea",
- "My First List"
]
}{- "id": "507f191e810c19729de860ea"
}Delete a contact via their unique ID or phone.
Example: Here we delete a Contact whose ID is507f1f77bcf86cd799439011. You can use the Get all Contacts endpoint to retrieve Contact IDs for all of your Contacts:
https://api-app2.simpletexting.com/v2/api/webhooks/507f1f77bcf86cd799439011
| contactIdOrNumber required | string Example: 507f1f77bcf86cd799439011 Contact ID in hexadecimal format or phone number Example: |
For a given account, return all contacts that have been created in the account. A paginated list of contacts will be returned to you:
Example: Here we return all Contacts from an account since April 28th 2021:
https://api-app2.simpletexting.com/v2/api/contacts?page=100&size=2&since=2021-04-28T23:20:08.489Z&direction=ASC
| page | integer <int32> >= 0 Default: 0 Example: page=250 An ordinal number of the page to return with the results of a request (with the contacts of the given account). Please note that page numbering starts at zero ( Example: |
| size | integer <int32> <= 500 Default: 50 Example: size=150 The number of the returned contacts to show per page Example: |
| since | string <date-time> Example: since=2021-04-28T23:20:08.489Z List contacts updated since a specified date. The time is in ISO 8601 format. Example: |
| direction | string Default: "desc" Example: direction=desc Specify the sort order of your results. By default, results are sorted by the 'updated' field:
Example: |
{- "content": [
- {
- "contactId": "607f0558a7c898629dd47d7a",
- "contactPhone": "1234567890",
- "firstName": "John",
- "lastName": "Doe",
- "birthday": "1985-05-15",
- "lists": [
- {
- "id": "5f6c760379f4e93135aac72b",
- "name": "list name"
}
], - "customFields": {
- "zipcode": "12345"
}, - "comment": "VIP client",
- "subscriptionStatus": "OPT_IN",
- "created": "2021-04-28T23:20:08.489Z",
- "updated": "2021-05-28T20:20:08.489Z",
- "updateSource": "IMPORTED_FROM_FILE"
}
], - "totalPages": 0,
- "totalElements": 0
}Create a new contact and add them to a specific list.
Example: Below we created our contact, John Doe. We declared his custom field value for zipcode is 12345 and that he gets added to the list with an ID 507f191e810c19729de860ea and another list called My First List:
{ "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] }
| upsert | boolean Default: true If a contact already exists with the phone number in your request body, the contact will be updated with the information in the request when upsert is set to true. |
| listsReplacement | boolean Default: true If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list. |
| contactPhone | string Contact's phone number Example: |
| firstName | string Contact's first name Example: |
| lastName | string Contact's last name Example: |
string Contact's email Example: | |
| birthday | string Contact's birthday in format: yyyy-mm-dd Example: |
object (Key/value pairs) Object that contains custom field values, where you should use a Name or a Merge tag in a property name and a field value as a property value. To find a merge tag, please see the Contacts > Custom Fields section for your account. For example: if you have a custom field with the name Street address and the merge tag | |
| comment | string Notes about the contact. Example: |
| listIds | Array of strings All the lists (List IDs or names) to add the contact to or replace. Example: |
{- "contactPhone": "1234567890",
- "firstName": "John",
- "lastName": "Doe",
- "birthday": "1985-05-15",
- "customFields": {
- "zipcode": "12345"
}, - "comment": "VIP client",
- "listIds": [
- "507f191e810c19729de860ea",
- "My First List"
]
}{- "id": "507f191e810c19729de860ea"
}An endpoint to assist in batch operations on your contacts. Using these operations, you can update specific contact information, or delete contacts, all using the contacts phone as an ID.
Update multiple fields at once for a batch of contacts. You can update their first name, last name, emails, lists, and more.
Example: Here we are updating two contacts, seen in the array. The list replacement is set to true, so they will be removed from their existing list and added to a new one:
{ "updates": [ { "contactPhone": "1234567890", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "birthday": "1985-05-15", "customFields": { "zipcode": "12345" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] },{ "contactPhone": "0987654321", "firstName": "Jane", "lastName": "Doe", "email": "[email protected]", "birthday": "1984-05-25", "customFields": { "zipcode": "54321" }, "comment": "VIP client", "listIds": [ "507f191e810c19729de860ea", "My First List" ] } ], "listsReplacement": true }
Step 1: Start the task for the batch update with the above parameters. As a result, you receive the task ID.
Example:
{ "id": "6176fb3e141c0060668b2c03" }
Step 2: Request the task result by adding task ID from Step 1 to the Get update result request.
Example:
{
"status": "DONE",
"results":
[{ "done": true,
"contactPhone": "1234567890",
"contactId": "6176f999141c0060668b258e" },
{ "done": true,
"contactPhone": "0987654321",
"contactId": "1236f555141c0060668b123e"}],
"requestedCount": 2,
"processedCount": 2
}
| listsReplacement | boolean If listsReplacement is set to true, a contact will be removed from their existing list. If set to false, a contact will be added to a new list and stay in their original list. Example: |
required | Array of objects (ContactUpdate) [ 0 .. 500 ] items List of updates for contacts |
{- "listsReplacement": true,
- "updates": [
- {
- "contactPhone": "1234567890",
- "firstName": "John",
- "lastName": "Doe",
- "birthday": "1985-05-15",
- "customFields": {
- "zipcode": "12345"
}, - "comment": "VIP client",
- "listIds": [
- "507f191e810c19729de860ea",
- "My First List"
]
}
]
}{- "id": "507f191e810c19729de860ea"
}Delete a group of contacts from SimpleTexting using their phone numbers.
Example: Below, we delete a batch of contacts identified here by their phone number in the array:
{ "contactPhones": [ "1234567890", "0987654321", "1122334455" ] }
| contactPhones required | Array of strings (List of contacts' phone numbers for deletion
**Example:** `["1234567890","1234567891"]`) [ 0 .. 500 ] items |
{- "contactPhones": [
- "1234567890"
]
}{- "results": [
- {
- "done": true,
- "contactPhone": "1234567890",
- "contactId": "507f1f77bcf86cd799439011",
- "errorCode": "UNKNOWN_CONTACT_PHONE",
- "errorMessage": "Contact with provided phone number is missing"
}
]
}Return the result of a batch update by the task id.
| taskId required | string Example: 6176fb3e141c0060668b2c03 The ID of the task for the batch update Example: |
{- "status": "IN_PROGRESS",
- "results": [
- {
- "done": true,
- "contactPhone": "1234567890",
- "contactId": "507f1f77bcf86cd799439011",
- "errorCode": "CONTACT_CREATE_FAILED",
- "errorMessage": "Contacts limit is reached"
}
], - "requestedCount": 400,
- "processedCount": 400
}Update the name of an existing list.
Example: Here we updated a list name with a new name My Newer List:
{ "name": "My Newer List" }
| listId required | string Example: 507f1f77bcf86cd799439011 List ID in hexadecimal format or name. Example: 507f1f77bcf86cd799439011 / My Newer list |
| name required | string A list name containing less than 42 characters Example: |
{- "name": "My new list"
}{- "id": "507f191e810c19729de860ea"
}Retrieves all lists from your SimpleTexting account.
Example: Here we return all lists from an account:
https://api-app2.simpletexting.com/v2/api/contact-lists?page=100&size=2
| page | integer <int32> >= 0 Default: 0 Example: page=15 An ordinal number of the page to return with the results of a request (with the lists of the given account). Please note that page numbering starts at zero ( Example: |
| size | integer <int32> <= 500 Default: 50 Example: size=50 The number of the returned lists to show per page Example: |
{- "content": [
- {
- "listId": "507f191e810c19729de860ea",
- "name": "My First List",
- "created": "2021-04-28T23:20:08.489Z",
- "updated": "2021-04-28T23:20:08.489Z",
- "description": "List for 'SALE' keyword",
- "totalContactsCount": 25,
- "activeContactsCount": 40,
- "invalidContactsCount": 1,
- "unsubscribedContactsCount": 2,
- "keywords": "MYFIRSTKEYWORD"
}
], - "totalPages": 0,
- "totalElements": 0
}This endpoint is used to create a new contact list in a given SimpleTexting account.
Example: Here we create a list whose name is My New List:
{ "name": "My New List" }
| name required | string A list name containing less than 42 characters Example: |
{- "name": "My new list"
}{- "id": "507f191e810c19729de860ea"
}Add contact to specified list.
| listIdOrName required | string Example: 507f191e810c19729de860ea / My First List List ID or name to add the contact. Example: 507f191e810c19729de860ea / My First List |
| contactPhoneOrId | string Contact ID in hexadecimal format or the contact's phone number. Example: |
{- "contactPhoneOrId": "3051234567 / 507f1f77bcf86cd799439011"
}Return a contact list by its unique list ID or name.
Example: Below, we return the information associated with the List whose ID is 507f1f77bcf86cd799439011. You can use the Get all Lists endpoint to retrieve List IDs for all of your Lists:
https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011
| listIdOrName required | string Example: 507f1f77bcf86cd799439011 List ID in hexadecimal format or name. Example: 507f1f77bcf86cd799439011 / My new list |
{- "listId": "507f191e810c19729de860ea",
- "name": "My First List",
- "created": "2021-04-28T23:20:08.489Z",
- "updated": "2021-04-28T23:20:08.489Z",
- "description": "List for 'SALE' keyword",
- "totalContactsCount": 25,
- "activeContactsCount": 40,
- "invalidContactsCount": 1,
- "unsubscribedContactsCount": 2,
- "keywords": "MYFIRSTKEYWORD"
}Delete an existing list using the list ID or name.
Example: Here we delete a List whose ID is507f1f77bcf86cd799439011. You can use the [Get all Lists] (#operation/getLists) endpoint to retrieve List IDs for all of your Lists:
https://api-app2.simpletexting.com/v2/api/contact-lists/507f1f77bcf86cd799439011
| listIdOrName required | string Example: 507f1f77bcf86cd799439011 List ID in hexadecimal format or name. Example: 507f1f77bcf86cd799439011 / My new list |
Remove contact from specified list.
| listIdOrName required | string Example: 507f191e810c19729de860ea / My First List List ID or name to remove the contact from. Example: 507f191e810c19729de860ea / My First List |
| contactPhoneOrId required | string Example: 3051234567 Contact ID in hexadecimal format or the contact's phone number. Example: |
Retrieves all segments from your SimpleTexting account.
Example: Here we return all segments from an account:
https://api-app2.simpletexting.com/v2/api/contact-segments?page=100&size=2
| page | integer <int32> >= 0 Default: 0 An ordinal number of the page to return with the results of a request (with the segments of the given account). Please note that page numbering starts at zero ( |
| size | integer <int32> <= 500 Default: 50 Example: size=50 The number of the returned segments to show per page |
{- "content": [
- {
- "segmentId": "507f191e810c19729de860ea",
- "name": "string",
- "created": "2019-08-24T14:15:22Z",
- "updated": "2019-08-24T14:15:22Z"
}
], - "totalPages": 0,
- "totalElements": 0
}SimpleTexting's Custom Fields feature plays a key role in managing your customer data. Not only does it give you enormous flexibility when it comes to collecting or importing data, it also lets you quickly and easily personalize each message in a mass text campaign.
This endpoint allows you to retrieve all custom fields.
Example: Here we return all Custom Fields from an account:
https://api-app2.simpletexting.com/v2/api/custom-fields?page=100&size=500
| page | integer <int32> >= 0 Default: 0 Example: page=40 An ordinal number of the page to return with the results of a request (with the custom fields of the given account). Please note that page numbering starts at zero ( Example: |
| size | integer <int32> <= 500 Default: 50 Example: size=50 The number of the returned custom fields to show per page Example: |
{- "content": [
- {
- "label": "My Custom Field",
- "type": "text",
- "mergeTag": "my_custom_field",
- "defaultMaxLength": 30
}
], - "totalPages": 0,
- "totalElements": 0
}Use webhooks to communicate between the SimpleTexting platform and your server. Webhooks can be used to forward messages as well as provide info about unsubscribes and message delivery.
SimpleTexting can trigger webhooks for new incoming messages, delivery reports, unsubscribes, and more. Now you can build scripts that interpret and respond to events that occur in your SimpleTexting account! To set the URLs for your webhooks, visit the Webhooks tab on the API section of settings.
Update an existing webhook using its unique ID.
| webhookId required | string Example: 507f1f77bcf86cd799439011 Webhook ID in hexadecimal format |
| url required | string The URL for handling a POST request Example: |
| triggers required | Array of strings Items Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT" Trigger a webhook based on a specific platform event:
Example: |
| requestPerSecLimit | integer <int32> <= 25 The maximum number of requests that can be sent within a second Example: |
| accountPhone | string Optional: requests will come exclusively for the specified account phone number Example: |
| contactPhone | string Optional: requests will come exclusively for the specified contact's phone number Example: |
{- "triggers": [
- "INCOMING_MESSAGE"
], - "requestPerSecLimit": 15,
- "accountPhone": "8881234567",
- "contactPhone": "3051234567"
}{- "id": "507f191e810c19729de860ea"
}Delete an existing Webhook by its unique ID.
Example: Here we delete a Webhook whose ID is507f1f77bcf86cd799439011. You can use the Get all Webhooks endpoint to retrieve message IDs for all of your Webhooks:
https://api-app2.simpletexting.com/v2/api/webhooks/507f1f77bcf86cd799439011
| webhookId required | string Example: 507f1f77bcf86cd799439011 Webhook ID in hexadecimal format |
Retrieve all the webhooks that you've created.
Example: Here we return all Webhooks from an account:
https://api-app2.simpletexting.com/v2/api/webhooks
| page | integer <int32> >= 0 Default: 0 Example: page=5 An ordinal number of the page to return with the results of a request (with the webhooks of the given account). Please note that page numbering starts at zero ( |
| size | integer <int32> <= 500 Default: 50 Example: size=50 The number of the returned webhooks to show per page |
{- "content": [
- {
- "webhookId": "507f191e810c19729de860ea",
- "triggers": "INCOMING_MESSAGE",
- "requestPerSecLimit": 20,
- "accountPhone": "8881234567",
- "contactPhone": "3051234567"
}
], - "totalPages": 0,
- "totalElements": 0
}Create a new webhook from scratch.
| url required | string The URL for handling a POST request Example: |
| triggers required | Array of strings Items Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT" Trigger a webhook based on a specific platform event:
Example: |
| requestPerSecLimit | integer <int32> <= 25 The maximum number of requests that can be sent within a second Example: |
| accountPhone | string Optional: requests will come exclusively for the specified account phone number Example: |
| contactPhone | string Optional: requests will come exclusively for the specified contact's phone number Example: |
{- "triggers": [
- "INCOMING_MESSAGE"
], - "requestPerSecLimit": 15,
- "accountPhone": "8881234567",
- "contactPhone": "3051234567"
}{- "id": "507f191e810c19729de860ea"
}Use webhooks to communicate between the SimpleTexting platform and your server. Webhooks can be used to forward messages as well as provide info about unsubscribes and message delivery. SimpleTexting can trigger webhooks for new incoming messages, delivery reports and unsubscribes.
Triggers when a client sends STOP to your number.
Example: We create the Unsubscribe report for 8005551234 for the status of the outgoing messages to 8001234567:
{"url": "http://www.yourdomain.com/unsubscribe.php","triggers": ["UNSUBSCRIBE_REPORT"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}
Your custom domain http://www.yourdomain.com/unsubscribe.php has been set as an unsubscribe report URL for this example. The SimpleTexting server will invoke the given call when the subscriber with the number 8001234567 unsubscribes.
| reportId | string Unique report ID in hexadecimal format Example: |
| webhookId | string Webhook ID in hexadecimal format Example: |
| type | string Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT" Webhook report content type: UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes Example: |
object (WebhookUnsubscribeReportDto) Report content |
{- "reportId": "507f191e810c19729de860ea",
- "webhookId": "507f191e810c19729de860ea",
- "type": "UNSUBSCRIBE_REPORT",
- "values": {
- "contactId": "507f191e810c19729de860ea",
- "phone": "8001234567"
}
}Triggers when an outgoing message or incoming message is handled.
Example: We create the incoming webhook for 8005551234 from contact phone 8001234567:
{"url": "http://www.yourdomain.com/receivesms.php","triggers": ["INCOMING_MESSAGE"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}
| reportId | string Unique report ID in hexadecimal format Example: |
| webhookId | string Webhook ID in hexadecimal format Example: |
| type | string Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT" Webhook report content type: UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes Example: |
object (WebhookMessageDto) Report content |
{- "reportId": "507f191e810c19729de860ea",
- "webhookId": "507f191e810c19729de860ea",
- "type": "UNSUBSCRIBE_REPORT",
- "values": {
- "messageId": "507f191e810c19729de860ea",
- "subject": "Some message from SimpleTexting",
- "mediaItems": [
- "507f1f77bcf86cd799439011",
- "507f1f77bcf86cd799439333"
], - "text": "Hello! How are you?",
- "accountPhone": "8005551234",
- "contactPhone": "8001234567",
- "timestamp": "2020-04-28T23:20:08.489Z",
- "category": "SMS",
- "referenceType": "API"
}
}Triggers when an outgoing message is reported as delivered or undelivered by the carrier.
Example: We create the Delivery report for 8005551234 for the status of the outgoing messages to 8001234567:
{"url": "http://www.yourdomain.com/delivery.php","triggers": ["DELIVERY_REPORT"],"requestPerSecLimit": 25,"accountPhone": "8005551234","contactPhone": "8001234567"}
Your custom domain http://www.yourdomain.com/delivery.php has been set as a delivery report webhook for this example. The SimpleTexting server will invoke the given call when a message with the messageId 507f191e810c19729de860ea is delivered.
| reportId | string Unique report ID in hexadecimal format Example: |
| webhookId | string Webhook ID in hexadecimal format Example: |
| type | string Enum: "INCOMING_MESSAGE" "OUTGOING_MESSAGE" "DELIVERY_REPORT" "NON_DELIVERED_REPORT" "UNSUBSCRIBE_REPORT" Webhook report content type: UNSUBSCRIBE_REPORT: Triggered when a contact unsubscribes Example: |
object (WebhookDeliveryReportDto) Report content |
{- "reportId": "507f191e810c19729de860ea",
- "webhookId": "507f191e810c19729de860ea",
- "type": "UNSUBSCRIBE_REPORT",
- "values": {
- "messageId": "507f191e810c19729de860ea",
- "category": "SMS",
- "referenceType": "API",
- "accountPhone": "8005551234",
- "contactPhone": "8001234567",
- "carrier": "Verizon"
}
}