Create an API token
POST
/api/v1/token
const url = 'https://app.shroud.email/api/v1/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"user@example.com","password":"correcthorsebatterystaple","totp":123456}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.shroud.email/api/v1/token \ --header 'Content-Type: application/json' \ --data '{ "email": "user@example.com", "password": "correcthorsebatterystaple", "totp": 123456 }'Creates an API token for your account. Keep the returned token secret.
Request Bodyrequired
Section titled “ Request Bodyrequired ”Credentials
Media type application/json
CreateToken
object
email
required
string format: email
password
required
string format: password
totp
Required when two-factor authentication is enabled.
integer
Example
{ "email": "user@example.com", "password": "correcthorsebatterystaple", "totp": 123456}Responses
Section titled “ Responses ”API token
Media type application/json
Token
object
token
required
Base64-encoded session token.
string
Example
{ "token": "c2hyb3VkLmVtYWlsIHRva2VuIDotKQ=="}Invalid email, password or TOTP code
Media type application/json
Error
object
error
required
string
Example
{ "error": "Invalid email, password or TOTP code"}