Authentication
The Emailhook API uses API key authentication.
Getting Your API Key
- Go to Settings
- Create a new API key
- Copy the key (it starts with
apk_
)
Using Your API Key
Include your API key in the Authorization
header as a Bearer token:
bash
curl -H "Authorization: Bearer apk_your_api_key_here" \
https://api.emailhook.com/v1/inboxes
Code Examples
JavaScript (fetch)
javascript
const response = await fetch('https://api.emailhook.com/v1/inboxes', {
headers: {
'Authorization': 'Bearer apk_your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
Python (requests)
python
import requests
headers = {
'Authorization': 'Bearer apk_your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.get('https://api.emailhook.com/v1/inboxes', headers=headers)
data = response.json()
Security Best Practices
- Keep your API key secret - never commit it to version control
- Use environment variables to store your API key
- Rotate your keys regularly for enhanced security