Create API key
curl --request POST \
--url https://api.moonemail.co/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: [],
domain_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expires_at: '<string>'
})
};
fetch('https://api.moonemail.co/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.moonemail.co/api-keys"
payload = {
"name": "<string>",
"scopes": [],
"domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "api_key",
"id": "<string>",
"token": "<string>",
"hint": "<string>",
"permission": "full_access",
"scopes": [
"inboxes:read"
],
"expires_at": "<string>"
}{
"statusCode": 123,
"name": "<string>",
"message": "<string>"
}API keys
Create API key
Create an API credential. Its token is returned once.
Required permission: api_keys:manage.
POST
/
api-keys
Create API key
curl --request POST \
--url https://api.moonemail.co/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [],
"domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
scopes: [],
domain_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
expires_at: '<string>'
})
};
fetch('https://api.moonemail.co/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.moonemail.co/api-keys"
payload = {
"name": "<string>",
"scopes": [],
"domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expires_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "api_key",
"id": "<string>",
"token": "<string>",
"hint": "<string>",
"permission": "full_access",
"scopes": [
"inboxes:read"
],
"expires_at": "<string>"
}{
"statusCode": 123,
"name": "<string>",
"message": "<string>"
}Authorizations
Moonemail API key; x-required-scope applies.
Body
application/json
Required string length:
1 - 50Available options:
full_access, sending_access, scoped_access Required array length:
1 - 15 elementsAvailable options:
inboxes:read, inboxes:write, receiving:read, emails:send, emails:read, emails:update, domains:read, domains:write, domains:delete, webhooks:read, webhooks:write, webhooks:delete, suppressions:read, suppressions:write, suppressions:delete Response
Success
Allowed value:
"api_key"Returned once. Save securely.
Available options:
full_access, sending_access, scoped_access Available options:
inboxes:read, inboxes:write, receiving:read, emails:send, emails:read, emails:update, domains:read, domains:write, domains:delete, webhooks:read, webhooks:write, webhooks:delete, suppressions:read, suppressions:write, suppressions:delete