Create Email Account
Creates a new permanent email account for the authenticated user.
Endpoint: POST /api/mail/create-mail
Creates a new permanent email account for the authenticated user.
Request Headers
Authorization: Bearer your_api_token_here
Content-Type: application/json
Request Body
{
"local_part": "desired_username" // Optional; if omitted, a random username is generated
}
Success Response
{
"email": "desired_username@domain.com",
"message": "Email account created successfully"
}
Error Responses
// 400 Bad Request
{
"error": "Invalid username format"
}
// 400 Bad Request
{
"error": "No available domains"
}
// 401 Unauthorized
{
"error": "No token provided"
}
// 403 Forbidden
{
"error": "Invalid token"
}
// 409 Conflict
{
"error": "Username already taken"
}
// 500 Internal Server Error
{
"error": "Failed to create email account"
}
Usage Examples
JavaScript (fetch)
fetch('https://mailblinker.com/api/mail/create-mail', {
method: 'POST',
headers: {
'Authorization': 'Bearer 5720c4dbb4601183486a9259a8e8f7b9b6fef2dc61f34ee901516995710e49aa',
'Content-Type': 'application/json'
},
body: JSON.stringify({ local_part: 'desired_username' })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Python (requests)
import requests
import sys
sys.stdout.reconfigure(encoding='utf-8')
url = 'https://mailblinker.com/api/mail/create-mail'
headers = {
'Authorization': 'Bearer 5720c4dbb4601183486a9259a8e8f7b9b6fef2dc61f34ee901516995710e49aa',
'Content-Type': 'application/json'
}
data = {
'local_part': 'desired_username'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
cURL
curl -X POST https://mailblinker.com/api/mail/create-mail \
-H "Authorization: Bearer your_api_token_here" \
-H "Content-Type: application/json" \
-d '{"local_part": "desired_username"}'