
Add a Subscriber
Learn how to use the Mobile Text Alerts API to add a subscriber to your account
Add a Subscriber with the Mobile Text Alerts API
Example request to add a subscriber
curl --location --request POST 'https://api.mobile-text-alerts.com/v3/subscribers' \
--header 'Authorization: Bearer <APIKey>' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "FirstName",
"lastName": "LastName",
"number": "+18002223333",
"email": "example@mobile-text-alerts.com"
}'async function main() {
const response = await fetch('https://api.mobile-text-alerts.com/v3/subscribers', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.MTA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
firstName: 'Sarah',
lastName: 'Johnson',
number: '+18002223333',
email: 'sarah@example.com',
groupIds: [123, 456],
subscriberFields: {
'2000': 'January 1st, 2000',
'2001': 'Premium'
}
})
});
const data = await response.json();
console.log(data);
}
main().catch((err) => {
console.error('Request failed:', err);
process.exitCode = 1;
});Example Response
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
firstNamestringOptional
lastNamestringOptional
emailstringOptional
numberone ofOptional
numberOptional
stringOptional
e164NumberstringOptional
groupIdsnumber[]Optional
employeeNumberstringOptional
welcomeMessagestringOptional
Responses
200
Success
application/json
400
BadRequestError
application/json
401
UnauthorizedError
application/json
403
ForbiddenError
application/json
429
RateLimitError
application/json
500
InternalServerError
application/json
post/subscribers
POST /v3/subscribers HTTP/1.1
Host: api.mobile-text-alerts.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 201
{
"firstName": "text",
"lastName": "text",
"email": "text",
"number": 1,
"e164Number": "text",
"groupIds": [
1
],
"subscriberFields": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"employeeNumber": "text",
"welcomeMessage": "text"
}{
"success": true,
"error": "text",
"message": "text",
"data": {
"id": 1,
"firstName": "text",
"lastName": "text",
"email": "text",
"number": 1,
"e164Number": "text",
"date": "2026-01-01T00:00:00.000Z",
"countryId": 1,
"groups": [
{
"id": 1,
"name": "text",
"addedToGroupAt": "2026-01-01T00:00:00.000Z"
}
],
"subscriberFieldData": [
{
"id": 1,
"subscriberFieldId": 1,
"data": "text"
}
],
"signupMethod": 1,
"longNumber": 1,
"carrierId": 1
}
}More Subscriber Actions
Last updated
Was this helpful?