Authentication

You'll need to authenticate your requests to access any of the endpoints in the Emailit API. In this guide, we'll look at how authentication works. Emailit offers one way to authenticate your API requests: Bearer authentication.

Bearer authentication

With Bearer authentication, you use your api key, generated in credentials, to authenticate your HTTP requests. Here's how to authenticate using cURL:

Example request with Bearer auth

curl https://api.emailit.com/v1/emails \
      -H "Authorization: Bearer {api_key}" \
      -H "Content-Type: application/json" \
      -d $'{
        "from": "Name <[email protected]>",
        "to": "[email protected]",
        "reply_to": "[email protected]",
        "subject": "Hello World",
        "html": "<h1>Hello World</h1>"
      }'

Please don't commit your Emailit API Key to GitHub!

Was this page helpful?