Skip to content

Updated Enpoints #75

@m0nkeypantz

Description

@m0nkeypantz

TEXTNOW API ENDPOINTS - WORKING AS OF 09/04/2025

BASE URL: https://www.textnow.com

MESSAGE FETCHING:
GET /api/users/{username}/messages
Parameters: start_message_id=0&direction=future&page_size=0
Purpose: Get all messages from any number

MESSAGE SENDING:
POST /api/users/{username}/messages
JSON: {"contact_value": "phone", "message_direction": 2, "contact_type": 2, "message": "text"}
Purpose: Send text messages

POST /api/v3/send_attachment
Form Data: contact_value=phone&contact_type=2&attachment_url=url&message_type=2&media_type=images
Purpose: Send images/media

MEDIA UPLOAD:
POST /api/v3/attachment_url
JSON: {"file_name": "image.jpg", "file_size": 12345}
Purpose: Get upload URL for media

PUT {pre-signed-url}
Body: Raw image data
Purpose: Upload media file

CONVERSATIONS:
GET /api/users/{username}/conversations
Purpose: Get all conversation threads

AUTHENTICATION:
Cookie: connect.sid={session}; _csrf={token}
Header: X-CSRF-Token: {token}
Header: User-Agent: Mozilla/5.0...
Header: X-Requested-With: XMLHttpRequest

MESSAGE STRUCTURE:
{
"id": "msg_id",
"contact_value": "phone_number",
"message": "text",
"message_direction": 1 or 2, // 1=incoming, 2=outgoing
"message_type": 1 or 2, // 1=text, 2=media
"media_url": "url" // for images
}

TextNow Voice Message API
Endpoint Discovery
After reverse engineering TextNow's web app, here's the complete API for sending voice messages:

  1. Get Upload URL
    http
    GET https://www.textnow.com/api/v3/attachment_url?message_type=3
    Response:

json
{
"result": "https://media.textnow.com/a0572a53-6ca9-5618-82cb-9c9229472b24?t=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"error_code": null
}
2. Upload Audio File
http
PUT [result_url_from_step_1]
Content-Type: audio/mpeg

[raw audio file data]
3. Send Voice Message
http
POST https://www.textnow.com/api/v3/send_attachment
Content-Type: application/x-www-form-urlencoded

contact_value=+1234567890&contact_type=2&attachment_url=[result_url]&message_type=3&media_type=audio&message=
Key Differences from Images/Video
Images/Video: message_type=2, response field media_url
Voice Messages: message_type=3, response field result
Upload method: Same PUT to pre-signed URL for both
Authentication Required
Session cookies: connect.sid, _csrf
Header: X-CSRF-Token
Header: User-Agent (standard browser UA)
Python Example
python

Step 1: Get upload URL

response = session.get('https://www.textnow.com/api/v3/attachment_url?message_type=3')
upload_url = response.json()['result']

Step 2: Upload audio

with open('voice.mp3', 'rb') as f:
requests.put(upload_url, data=f.read(), headers={'Content-Type': 'audio/mpeg'})

Step 3: Send message

data = {
'contact_value': '+1234567890',
'contact_type': '2',
'attachment_url': upload_url,
'message_type': '3',
'media_type': 'audio',
'message': ''
}
session.post('https://www.textnow.com/api/v3/send_attachment', data=data)
Supported Audio Formats
MP3 (tested with audio/mpeg)
Likely supports other formats but MP3 confirmed working
This API enables programmatic voice message sending through TextNow's platform!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions