How can I use the MoonMail API?

The MoonMail platform provides an easy to use GraphQL API to all its users.
The API can be accessed in two different ways:

1. The MoonMail API Explorer

If you want to start tinkering with the API immediately, you can do it in the API Explorer of your MoonMail account. You can run some queries and mutations in the explorer to have and idea about what the MoonMail API can offer you. The API Explorer is available to all the MoonMail users.

2. Making an API call

All MoonMail users but those in the Lite plan can create an API key in their profile's settings. You'll also need the location of the API endpoint and a way to authenticate your requests.
GraphQL API Endpoint:
Authentication: Include your API Key as an X-Api-Key header in all GraphQL queries and mutations as follows.
curl \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H 'Content-Type: application/graphql' \
For instance, you can copy the cURL request below into your terminal. Replace **<YOUR_API_KEY>** with your account's API key in settings and **<YOUR_QUERY_OR_MUTATION>** with the appropriate API call data. Run the query to see a response with your account status. 
curl \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H 'Content-Type: application/graphql' \
-X POST -d '{"query": "{Account {Status}}"}'
Suggested articles 
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us