1. Create an Account
Sign up for a JustSend account and verify your email address.
Send your first email with JustSend in four steps.
Sign up for a JustSend account and verify your email address.
Navigate to Domains and add the domain you want to send emails from.
JustSend will provide you with DNS records that you need to add to your domain. These records ensure your emails are properly authenticated:
Add these TXT records through your DNS provider, then click "Verify" on the domain page. DNS changes can take up to 48 hours to propagate, though they typically complete within minutes.
Go to Account and
create a new API client. You'll receive a client_id and
client_secret.
Important: Store your
client_secret securely. It will only be shown once.
Use your credentials to obtain an access token:
curl -X POST https://justsend.api/oauth2/token \
-u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-d "grant_type=client_credentials"
The response includes a Bearer token:
{
"access_token": "justsend_token_...",
"token_type": "Bearer",
"expires_in": 3600
}
Important: We handle authorization manually here because it's simple and instructive but we highly recommend you use a well supported OAuth 2.0 client library.
Use the access token to send your first email:
curl https://justsend.api/send \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--data '{
"from": "no-reply@yourdomain.com",
"to": "recipient@example.com",
"subject": "Hello from JustSend",
"text": "This is my first email sent via JustSend!",
"dry_run": true
}'
A successful response looks like:
{
"message": "Message queued"
}
If the request fails, the response includes an error message and details:
{
"message": "Failed to queue message",
"errors": [
{
"field": "from",
"detail": "Field required"
},
{
"field": "to",
"detail": "Value error, An email address must have an @-sign.",
"input": "invalid"
},
{
"field": "recipients",
"detail": "Value error, Total recipients cannot exceed 100"
}
]
}
For more details see our API Documentation.