Mail-in-a-Box API HTTP specification.
This API is documented in OpenAPI format. (View the full HTTP specification.)
All endpoints are relative to https://{host}/admin
and are secured with Basic Access
authentication.
Credentials can be supplied using the Authorization
header in
format Authorization: Basic {access-token}
.
The access-token
is comprised of the Base64 encoding of username:password
.
The username
is the mail user's email address, and password
can either be the mail user's
password, or the api_key
returned from the getMe
operation.
When using curl
, you can supply user credentials using the -u
or --user
parameter.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | basic |
Returns user information. Used for user authentication.
Authenticate a user by supplying the auth token as a base64 encoded string in
format email:password
using basic authentication headers.
If successful, a long-lived api_key
is returned which can be used for subsequent
requests to the API.
curl -X GET "https://{host}/admin/me" \ -u "<email>:<password>"
{- "reason": "Incorrect username or password",
- "status": "invalid"
}
Mail operations, which include getting all users, getting all aliases, adding/updating/removing users and aliases and getting all mail domains.
Returns all mail users.
format | string (MailUsersResponseFormat) Enum: "text" "json" Example: format=json The format of the response. |
curl -X GET "https://{host}/admin/mail/users?format=<string>" \ -u "<email>:<password>"
[- {
- "domain": "example.com",
- "users": [
- {
- "email": "user@example.com",
- "privileges": [
- "admin"
], - "status": "active",
- "mailbox": "/home/user-data/mail/mailboxes/example.com/user"
}
]
}
]
Adds a new mail user.
email required | string <email> (Email) Email format. |
password required | string <password> |
privileges required | string (MailUserPrivilege) Enum: "admin" "" Mail user privilege. |
email=user%40example.com&password=s3curE_pa5Sw0rD&privileges=
mail user added
updated DNS: OpenDKIM configuration
Removes an existing mail user.
email required | string <email> (Email) Email format. |
email=user%40example.com
OK
Adds a privilege to an existing mail user.
email required | string <email> (Email) Email format. |
privilege required | string (MailUserPrivilege) Enum: "admin" "" Mail user privilege. |
email=user%40example.com&privilege=admin