Unsubscribe Phone Numbers API

Unsubscribes phone numbers from receiving Text Messages. You can either provide a list of phone numbers or a CSV file containing the phone numbers.

URL

POST https://api.wknd.ai/text/unsubscribe

Request Headers

The following are used for authentication/authorization checks.

X-Client-ID: A 32-byte hashed string provided by Wunderkind.

X-Client-Secret: A 64-byte hashed string provided by Wunderkind.

Body Parameters

Model:

{
"phone_numbers": {
"phone_numbers": [
"+11234567890",
]

},
"csv_file": "cGhvbmVfbnVtYmVycworMTEyMzQ1Njc4OTAKKzE5ODc2NTQzMjEw"
}

phone_numbers - (optional) an array of strings.

  • Each phone number must be in E.164 format. e.g. ["+11234567890", "+19876543210"]
  • This field can be empty if csv_fileis specified.

csv_file - (optional) a CSV file containing phone numbers.

  • The file must be encoded in base64 before sending
  • The CSV file must have a header phone_numbers
  • Each phone number must be in E.164 format
  • This field can be empty if phone_numbers is specified

Either phone_numbers (maximum 5,000 phone numbers) or csv_file (maximum 50,000 phone numbers) must be specified.

Example CSV file content:

phone_numbers
+11234567890
+19876543210

Responses

Success Response - 200.

Model:

{
    "message": "We have received and are processing your request",
    "invalidPhoneNumbers": ["string"]
}

message - a message indicating that the request is being processed.

invalidPhoneNumbers - a list of phone numbers that were invalid or not processed..

Error Responses

Model:

{
    "code": 0,
    "message": "string",
    "details": []
}
  • code - error code
  • message - error message
  • Details - (optional) additional info will be appended here

Error Codes

  • 401 - Unauthorized
  • 403 - Forbidden
  • 429 - Denied (exceed the limits)
  • 4XX(others) - Bad Request
  • 5XX - Internal Server Error

Examples

Request with phone_number:

curl -X 'POST' \
'https://api.wknd.ai/text/unsubscribe' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Client-ID: ********s19bvx18vly70bk5********' \
-H 'X-Client-Secret: ********c2a4b82f10f8a137b1b056c6f3f3909ddc062a6fb6b4826c********' \
-d '{
    "phone_numbers": ["+11234567890", "+19876543210"]
}'

Response:

{
    "message": "We have received and are processing your request",
    "invalidPhoneNumbers": []
}

Request with csv_file:

curl -X 'POST' \
'https://api.wknd.ai/text/unsubscribe' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Client-ID: ********s19bvx18vly70bk5********' \
-H 'X-Client-Secret: ********c2a4b82f10f8a137b1b056c6f3f3909ddc062a6fb6b4826c********' \
-d '{
    "csv_file": "cGhvbmVfbnVtYmVycworMTEyMzQ1Njc4OTAKKzE5ODc2NTQzMjEw"
}'

Response:

{
    "message": "We have received and are processing your request",
    "invalidPhoneNumbers": []
}