Need help authenticating Mailjet API via HTTP Request (custom API)

Hi everyone,

I’m trying to connect the Mailjet API to n8n using the HTTP Request node (custom API), as I want to automate the creation of email campaigns from my Excel file.

I already have the following prerequisites:

My goal is to use the https://api.mailjet.com/v3/REST/campaigndraft endpoint to create campaign drafts, as well as other endpoints related to campaigns (messages, contact lists, etc.).
However, I’m unsure about the exact configuration I should use in the HTTP Request node (authentication, headers, body, etc.).

Has anyone successfully done this integration and could share a working configuration example to help me get started?

Thanks a lot for your help :folded_hands:

As per the documentation of mailjet it uses basic auth with the secret and id as your username and password.

On the http node, select the basic auth option and then create a new credential

Give the connection a name in the top left and then use the api key as username and secret as password as per the documentation and click save

1 Like

Thank you for your help, but that’s exactly what I’m doing. When I make an HTTP Request, I get the following message:

Then you might have added the auth incorrectly. I created an account now and added a contact from an http node. Can you check if you can run this node using your credentials.

Oh wait I see the issue. You’re using a GET method on the contactfilter for segmentaiton. I believe there is only a POST available for creating segmentations. If you want to copy the api into n8n, click the copy button on curl from the api documentation:

Then create a new http node and click the import curl, then paste and click Import

This will fill in the http node properties correctly. Then disable the header toggle to remove the copied auth and then set to your basic auth

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.