Mailjet
Send transactional and marketing email and manage contact lists via the Mailjet API.
A standard-library-only InTouch tool: no requests, no SDK. It calls Mailjet's
Send API v3.1 and REST API v3 directly with HTTP Basic auth.
What it does
| Operation | Method & endpoint | Purpose |
|---|---|---|
send-email |
POST /v3.1/send |
Send a transactional or marketing email |
list-lists |
GET /v3/REST/contactslist |
List your contact lists |
create-list |
POST /v3/REST/contactslist |
Create a new contact list |
list-contacts |
GET /v3/REST/contact |
List contacts (optionally within one list) |
- Base URLs:
https://api.mailjet.com/v3.1(Send API) andhttps://api.mailjet.com/v3/REST(REST API). - Body cap: responses are truncated at ~5 MB.
apiKey setup
Mailjet authenticates with HTTP Basic auth using two values: your API Key
(public) and your Secret Key (private). The Mailjet curl idiom is
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE".
- Sign in to the Mailjet dashboard.
- Go to Account Settings → API Key Management (REST API).
- Copy your API Key and Secret Key.
- Pass them to this tool as a single
apiKeyvalue joined with a colon:PUBLIC:PRIVATE(e.g.a1b2c3...:9f8e7d...).
Both halves are base64-encoded together into the Authorization: Basic header,
so no live OAuth/JWT exchange is needed — a single key string is sufficient.
Sender addresses used in
send-emailmust be validated senders/domains in your Mailjet account, or the API will reject the message.
Inputs
apiKey(required) —PUBLIC:PRIVATEoperation(required) — one ofsend-email,list-lists,create-list,list-contactsfromEmail,fromName,to,subject,text,html— forsend-emailname— forcreate-listcontactsList— optional list ID filter forlist-contactslimit,offset— optional pagination forlist-lists/list-contacts
Outputs
result— the Mailjet response payload as a JSON stringstatus— the HTTP status code
Examples
Send a transactional email:
{
"apiKey": "PUBLIC_KEY:SECRET_KEY",
"operation": "send-email",
"fromEmail": "[email protected]",
"fromName": "Your App",
"to": "[email protected],[email protected]",
"subject": "Your receipt",
"text": "Thanks for your order!",
"html": "<h3>Thanks for your order!</h3>"
}
List your contact lists:
{
"apiKey": "PUBLIC_KEY:SECRET_KEY",
"operation": "list-lists",
"limit": "20"
}
Create a contact list:
{
"apiKey": "PUBLIC_KEY:SECRET_KEY",
"operation": "create-list",
"name": "newsletter-subscribers"
}
List contacts in a specific list:
{
"apiKey": "PUBLIC_KEY:SECRET_KEY",
"operation": "list-contacts",
"contactsList": "123456",
"limit": "50"
}