1. Overview

1.1. Version information

Version : 1.1

1.2. Contact information

Contact : Alinto
Contact Email : supportpro@alinto.net

1.3. License information

License : Copyright Alinto
License URL : http://licence.alinto.net/licence/?lang=en

1.4. URI scheme

Host : localhost
BasePath : /api/protect/v1

1.5. Tags

  • policy-controller : API for policies management. A policy defines a set of operating properties. When you create a domain, a policy is automatically created with a set of default values. A policy is attached to a domain but only one is active. Other policies can be affected to the users of the domain. A policy combines the properties of the different levels of service (quarantine, retention, archive). Relay is the default level of service which is enabled only if all the other levels are disabled. You cannot use an API on a level that your domain does not declare (404 will be returned).

  • user-controller : API for users management. A user is attached to an existing domain. You must then first create a domain before creating a user.

  • black-list-controller : API for black list management. A blacklist depends on a domain or on a user

  • platform-controller : API for platforms management. A platform declares the details of the machine on which will be relayed the messages. You can declare fallback properties which will be used in case of problem.

  • alias-controller : API for aliases management. An alias depends on a domain. Aliases are use to indicate a domain with other specified names

  • domain-controller : API for domains management. A domain depends on a platform. Before creating a new domain you have to create the platform by using given APIs.

  • group-controller : API for mailing list management. A mailing list depends on a domain and contains a list of users

  • email-controller : API for emails management. An email depends on a user.

  • white-list-controller : API for whitelist management. A whitelist depends on a domain or a user.

2. Authentication

All API requests require a basic authentication.
If basic authentication is invalid or omitted, then an error message will be returned with status code 401.

Example of a valid API request:

GET -u "alinto@example.com:userpassword" [url]

3. Authorization

Each request is subject to specific rights. Most of them are accessible for administrator users. However some of them need a specific role of sysadmin.
When you try to execute a request without the required rights, an error message will be returned with the 403 status code. +

4. Resources

4.1. Alias-controller

API for aliases management. An alias depends on a domain. Aliases are use to indicate a domain with other specified names

4.1.1. Add aliases to a domain.

POST /domains/{domainId}/aliases
Description

Add new names to the existing aliases list. Returns the list of added elements

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

aliases list
optional

The list of aliases to add to the list of existing aliases

< string > array

Responses
HTTP Code Description Schema

200

OK

< Alias > array

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

409

An alias or a domain may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/aliases HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 27

["starks.net","wolves.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 84

[ {
  "id" : 3,
  "name" : "starks.net"
}, {
  "id" : 4,
  "name" : "wolves.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/aliases' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["starks.net","wolves.net"]'

4.1.2. Get the aliases lists of a domain

GET /domains/{domainId}/aliases
Description

Returns the aliases lists of the domain

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

< Alias > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/aliases HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 86

[ {
  "id" : 1,
  "name" : "lions.net"
}, {
  "id" : 2,
  "name" : "lanisters.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/aliases' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.1.3. Update the aliases of a domain.

PATCH /domains/{domainId}/aliases
Description

Replace the aliases of the domain by the given list of aliases. Returns the list of aliases

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

the aliases to replace with
optional

aliases list

< string > array

Responses
HTTP Code Description Schema

200

OK

< Alias > array

204

No Content

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

409

An alias may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/2/aliases HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 29

["lanisters.net","lions.net"]
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 86

[ {
  "id" : 1,
  "name" : "lanisters.net"
}, {
  "id" : 2,
  "name" : "lions.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/aliases' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["lanisters.net","lions.net"]'

4.1.4. Delete an alias.

DELETE /domains/{domainId}/aliases/{aliasId}
Description

Delete an alias using its ID.

Parameters
Type Name Description Schema Default

Path

aliasId
required

aliasId

integer(int32)

Path

domainId
required

domainId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Group

204

No Content

No Content

400

A problem occured. Possible cause : at least one parameter might not match required format

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain and/or the alias may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/aliases/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/aliases/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.2. Black-list-controller

API for black list management. A blacklist depends on a domain or on a user

4.2.1. Add emails or domains to the blacklist of a domain.

POST /domains/{domainId}/blacklist
Description

Add a list of elements to the blacklist of the domain. Returns the list of added elements.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

blacklist
optional

The list of elements to add to the domain’s blacklist. It is possible to blacklist a user or an entire domain.
To blacklist a user please follow this pattern : "user@domain.com".
To blacklist a domain, please follow this pattern : "domain.com".

< string > array

Responses
HTTP Code Description Schema

200

OK

< WBList > array

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

409

This item may already be blacklisted

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/blacklist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 32

["rickon@stark.net","tywin.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 91

[ {
  "id" : 3,
  "email" : "rickon@stark.net"
}, {
  "id" : 4,
  "email" : "tywin.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/blacklist' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["rickon@stark.net","tywin.net"]'

4.2.2. Get the blacklist of a domain

GET /domains/{domainId}/blacklist
Description

Returns the blacklist of the domain

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< WBList > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/blacklist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 95

[ {
  "id" : 4,
  "email" : "deadguys.fr"
}, {
  "id" : 5,
  "email" : "joffrey@badguys.fr"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/blacklist' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.2.3. Delete an element from the blackList of a domain.

DELETE /domains/{domainId}/blacklist/{itemId}
Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

itemId
required

itemId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

WBList

204

No Content

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain ot the item may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/blacklist/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/blacklist/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.2.4. Add emails or domains to the blacklist of a user.

POST /domains/{domainId}/users/{userId}/blacklist
Description

Add a list of elements to the blacklist of the user. Returns the list of added elements.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Body

blacklist
optional

The list of elements to add to the users' blacklist. It is possible to blacklist a user or an entire domain.
To blacklist a user please follow this pattern : "user@domain.com".
To blacklist a domain, please follow this pattern : "domain.com".

< string > array

Responses
HTTP Code Description Schema

200

OK

< WBList > array

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

409

This item may already be blacklisted

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/users/2/blacklist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 36

["stark.net","tommen@baratheon.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 95

[ {
  "id" : 3,
  "email" : "stark.net"
}, {
  "id" : 4,
  "email" : "tommen@baratheon.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/blacklist' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["stark.net","tommen@baratheon.net"]'

4.2.5. Get the blacklist of a user

GET /domains/{domainId}/users/{userId}/blacklist
Description

Returns the blacklist of the user

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< WBList > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/users/2/blacklist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 89

[ {
  "id" : 4,
  "email" : "alive.fr"
}, {
  "id" : 5,
  "email" : "joffrey@dead.fr"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/blacklist' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.2.6. Delete an element from the blackList of a user.

DELETE /domains/{domainId}/users/{userId}/blacklist/{itemId}
Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

itemId
required

itemId

integer(int32)

Path

userId
required

userId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

WBList

204

No Content

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user or the item may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/users/2/blacklist/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/blacklist/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.3. Domain-controller

API for domains management. A domain depends on a platform. Before creating a new domain you have to create the platform by using given APIs.

4.3.1. Add a new domain

POST /domains
Description

Create a new domain. System will create a default policy with the given datas (quarantine, archive, retention). Next, use policies API to set default values of different services. You must specify an existing platform. Only sysadmin can create a new domain.

Parameters
Type Name Description Schema Default

Body

domain
optional

domain

Domain

Responses
HTTP Code Description Schema

201

Created

Domain

400

A problem occured. Possible cause : the domain name does not match required format

No Content

401

Unauthorized

No Content

403

Authorisation failure. You may have reached the limitation of domain creation or you do not have the sysadmin role.

No Content

404

Not Found

No Content

409

A domain may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 157

{"name":"got.com","status":"ENABLED","quarantine":true,"retention":false,"archive":false,"defaultLanguage":"EN_GB","autoProvisioningOn":false,"platformId":1}
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 210

{
  "id" : 2,
  "name" : "got.com",
  "status" : "ENABLED",
  "quarantine" : true,
  "retention" : false,
  "archive" : false,
  "defaultLanguage" : "EN_GB",
  "autoProvisioningOn" : false,
  "platformId" : 1
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"name":"got.com","status":"ENABLED","quarantine":true,"retention":false,"archive":false,"defaultLanguage":"EN_GB","autoProvisioningOn":false,"platformId":1}'

4.3.2. Get list of domains

GET /domains
Description

Returns a list of domains of the platform

Parameters
Type Name Description Schema Default

Query

offset
optional

Index of the first domain to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of domains returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< Domain > array

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 648

[ {
  "id" : 1,
  "name" : "lannister.net",
  "status" : "ENABLED",
  "quarantine" : true,
  "retention" : true,
  "archive" : true,
  "defaultLanguage" : "FR_FR",
  "autoProvisioningOn" : false,
  "platformId" : 1
}, {
  "id" : 2,
  "name" : "stark.net",
  "status" : "ENABLED",
  "quarantine" : false,
  "retention" : false,
  "archive" : false,
  "defaultLanguage" : "FR_FR",
  "autoProvisioningOn" : false,
  "platformId" : 1
}, {
  "id" : 3,
  "name" : "tyrel.net",
  "status" : "ENABLED",
  "quarantine" : false,
  "retention" : false,
  "archive" : false,
  "defaultLanguage" : "EN_GB",
  "autoProvisioningOn" : false,
  "platformId" : 1
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.3.3. Get a domain

GET /domains/{domainId}
Description

Get an existing domain

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Domain

401

Unauthorized

No Content

403

Forbidden

No Content

404

Domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 211

{
  "id" : 2,
  "name" : "got.com",
  "status" : "ENABLED",
  "quarantine" : false,
  "retention" : false,
  "archive" : false,
  "defaultLanguage" : "EN_GB",
  "autoProvisioningOn" : false,
  "platformId" : 1
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.3.4. Delete a domain

DELETE /domains/{domainId}
Description

Delete an existing domain and its users. Only sysadmin can delete a domain.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Domain

204

No Content

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.3.5. Update a domain

PATCH /domains/{domainId}
Description

Edit properties of an existing domain. Apply changes only on specified fields in request. Attributes which are not provided will not be updated.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

domain
optional

domain

Domain

Responses
HTTP Code Description Schema

200

OK

Domain

204

No Content

No Content

400

A problem occured. Possible cause : the domain name does not match required format

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 27

{"defaultLanguage":"ES_ES"}
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 212

{
  "id" : 2,
  "name" : "pati.net",
  "status" : "ENABLED",
  "quarantine" : false,
  "retention" : false,
  "archive" : false,
  "defaultLanguage" : "ES_ES",
  "autoProvisioningOn" : false,
  "platformId" : 1
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"defaultLanguage":"ES_ES"}'

4.4. Email-controller

API for emails management. An email depends on a user.

4.4.1. Search and release emails

POST /users/{userId}/emails/release
Description

Search for emails using criterias; then release them : mails are sent to their original mailboxes. Returns the list of criterias.

Parameters
Type Name Description Schema Default

Path

userId
required

userId

integer(int32)

Body

MessageCriterias
optional

MessageCriterias

MessageCriterias

Responses
HTTP Code Description Schema

201

Created

MessageCriterias

400

A problem occured.

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

A problem occured. The user or the mail may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

4.4.2. Release an email

POST /users/{userId}/emails/{folderId}/{emailId}/release
Description

Release an email via its folder (e.g. "INBOX") and id : the mail is sent to its original mailbox

Parameters
Type Name Description Schema Default

Path

emailId
required

emailId

integer(int32)

Path

folderId
required

folderId

string

Path

userId
required

userId

integer(int32)

Responses
HTTP Code Description Schema

201

Created

ReleasedMessage

400

A problem occured.

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

A problem occured. The user or the mail may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

4.5. Group-controller

API for mailing list management. A mailing list depends on a domain and contains a list of users

4.5.1. Add a new mailing list

POST /domains/{domainId}/groups
Description

Create a new mailing list. Returns the new mailing list

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

mailing list
optional

mailing list

Group

Responses
HTTP Code Description Schema

201

Created

Group

400

A problem occured. Arguments passed to the request may not match required format or the mailing list’s domain may not match the domain

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain and/or the mailing list may not exist

No Content

409

A mailing list may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/groups HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 28

{"email":"faceless@men.net"}
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 46

{
  "id" : 2,
  "email" : "faceless@men.net"
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"email":"faceless@men.net"}'

4.5.2. Get the mailing lists of a domain

GET /domains/{domainId}/groups
Description

Returns the list of mailing list of the domain

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< Group > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/groups HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 145

[ {
  "id" : 1,
  "email" : "badguys@got.net"
}, {
  "id" : 3,
  "email" : "deadguys@got.net"
}, {
  "id" : 2,
  "email" : "goodguys@got.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.5.3. Delete a mailing list.

DELETE /domains/{domainId}/groups/{groupId}
Description

Delete a mailing list using its ID.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

groupId
required

groupId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Group

204

No Content

No Content

400

A problem occured. Possible cause : at least one parameter might not match required format or the mailing list’s domain may not match the domain

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain and/or the mailing list may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/groups/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.5.4. Update a mailing list.

PATCH /domains/{domainId}/groups/{groupId}
Description

Edit the email of an existing mailing list. Returns the updated mailing list

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

groupId
required

groupId

integer(int32)

Body

group
optional

group

Group

Responses
HTTP Code Description Schema

200

OK

Group

204

No Content

No Content

400

A problem occured. Possible cause : at least one parameter might not match required format or the mailing list’s domain may not match the domain

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain and/or the mailing list may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/2/groups/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 28

{"email":"deadguys@got.net"}
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 46

{
  "id" : 1,
  "email" : "deadguys@got.net"
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups/1' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"email":"deadguys@got.net"}'

4.5.5. Add addresses to a mailing list

POST /domains/{domainId}/groups/{groupId}/addresses
Description

Add a list of addresses to a mailing list. Returns the mailing list

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

groupId
required

groupId

integer(int32)

Body

Users list
optional

List of the emails addresses

< string > array

Responses
HTTP Code Description Schema

200

OK

Group

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/groups/1/addresses HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 36

["joffrey@got.net","ramsay@got.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 45

{
  "id" : 1,
  "email" : "badguys@got.net"
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups/1/addresses' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["joffrey@got.net","ramsay@got.net"]'

4.5.6. Get the users of a mailing list

GET /domains/{domainId}/groups/{groupId}/addresses
Description

Returns the list of users of the the mailing list

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

groupId
required

groupId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< UserGroup > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/groups/1/addresses HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 303

[ {
  "id" : 2,
  "email" : "joffrey@got.net",
  "firstname" : "Joffrey",
  "lastname" : "Baratheon"
}, {
  "id" : 3,
  "email" : "ramsay@got.net",
  "firstname" : "Ramsay",
  "lastname" : "Bolton"
}, {
  "id" : 4,
  "email" : "themontain@got.net",
  "firstname" : "Gregor",
  "lastname" : "Clegane"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups/1/addresses' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.5.7. Delete an address from a mailing list.

DELETE /domains/{domainId}/groups/{groupId}/addresses/{addressId}
Description

Delete an address using the user ID.

Parameters
Type Name Description Schema Default

Path

addressId
required

addressId

integer(int32)

Path

domainId
required

domainId

integer(int32)

Path

groupId
required

groupId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Group

204

No Content

No Content

400

A problem occured. Possible cause : at least one parameter might not match required format or the mailing list’s domain may not match the domain

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain and/or the user and/or the mailing list may not exist ; the domain may not contain the user

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/groups/1/addresses/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/groups/1/addresses/2' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.5.8. Get the mailing lists of a user

GET /domains/{domainId}/users/{userId}/groups
Description

Returns the list of mailing list to which the user belongs

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< Group > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/users/2/groups HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 171

[ {
  "id" : 1,
  "email" : "themaid@oftarth.net"
}, {
  "id" : 2,
  "email" : "briennetheblue@oftarth.net"
}, {
  "id" : 3,
  "email" : "briennethebeauty@oftarth.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/groups' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.6. Platform-controller

API for platforms management. A platform declares the details of the machine on which will be relayed the messages. You can declare fallback properties which will be used in case of problem.

4.6.1. Add a new platform

POST /platforms
Description

Create a new plaform. Only sysadmin can create a platform.

Parameters
Type Name Description Schema Default

Body

platform
optional

platform

Platform

Responses
HTTP Code Description Schema

201

Created

Platform

400

A problem occured. Arguments passed to the request may not match required format

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Not Found

No Content

409

A platform may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /platforms HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 95

{"name":"plaformA","transportDest":"smtp.target.net","transportType":"SMTP","transportPort":25}
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 230

{
  "id" : 3,
  "name" : "plaformA",
  "transportDest" : "smtp.target.net",
  "transportType" : "SMTP",
  "transportPort" : 25,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/platforms' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"name":"plaformA","transportDest":"smtp.target.net","transportType":"SMTP","transportPort":25}'

4.6.2. Get a list of platforms

GET /platforms
Description

Returns the list of configured platforms. Only sysadmin can get the list of platforms.

Parameters
Type Name Description Schema Default

Query

offset
optional

Index of the first plaform to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of platforms returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< Platform > array

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /platforms HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 703

[ {
  "id" : 1,
  "name" : "platform",
  "transportDest" : "smtp.junit.net",
  "transportType" : "SMTP",
  "transportPort" : 25,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
}, {
  "id" : 2,
  "name" : "PlatformA",
  "transportDest" : "smtp.domainA.net",
  "transportType" : "SMTP",
  "transportPort" : 25,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
}, {
  "id" : 3,
  "name" : "PlatformB",
  "transportDest" : "smtp.domainB.net",
  "transportType" : "SMTPS",
  "transportPort" : 495,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/platforms' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.6.3. Get a plaform

GET /platforms/{platformId}
Description

Get datas of an given platform. Only sysadmin can get a platform.

Parameters
Type Name Description Schema Default

Path

platformId
required

platformId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Platform

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Platform not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /platforms/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 232

{
  "id" : 2,
  "name" : "PlatformA",
  "transportDest" : "smtp.domainA.net",
  "transportType" : "SMTP",
  "transportPort" : 25,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/platforms/2' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.6.4. Delete a platform.

DELETE /platforms/{platformId}
Description

Delete an existing platform. Only sysadmin can delete a platform.

Parameters
Type Name Description Schema Default

Path

platformId
required

platformId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Platform

204

No Content

No Content

400

A problem occured. Possible cause : the plaform is used by a domain.

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Platform not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /platforms/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/platforms/2' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.6.5. Update a platform.

PATCH /platforms/{platformId}
Description

Edit properties of an existing platform. Apply changes only on specified fields in request. Attributes which are not provided will not be updated. Only sysadmin can edit a platform.

Parameters
Type Name Description Schema Default

Path

platformId
required

platformId

integer(int32)

Body

platform
optional

platform

Platform

Responses
HTTP Code Description Schema

200

OK

Platform

204

No Content

No Content

400

A problem occured. Possible cause : at least one parameter might not match required format

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Platform not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /platforms/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 45

{"transportType":"SMTPS","transportPort":495}
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 234

{
  "id" : 2,
  "name" : "PlatformA",
  "transportDest" : "smtp.domainA.net",
  "transportType" : "SMTPS",
  "transportPort" : 495,
  "fallbackTransportDest" : null,
  "fallbackTransportType" : null,
  "fallbackTransportPort" : null
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/platforms/2' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"transportType":"SMTPS","transportPort":495}'

4.7. Policy-controller

API for policies management. A policy defines a set of operating properties. When you create a domain, a policy is automatically created with a set of default values. A policy is attached to a domain but only one is active. Other policies can be affected to the users of the domain. A policy combines the properties of the different levels of service (quarantine, retention, archive). Relay is the default level of service which is enabled only if all the other levels are disabled. You cannot use an API on a level that your domain does not declare (404 will be returned).

4.7.1. Add a new policy

POST /domains/{domainId}/policies
Description

Create a new policy in a given domain. Only sysadmin can create a new policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

policy
optional

policy

Policy

Responses
HTTP Code Description Schema

201

Created

Policy

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Not Found

No Content

409

A policy may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/1/policies HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 130

{"name":"policyA","quarantine":true,"retention":false,"archive":false,"advertPrefix":"[ADVERT]","mailSizeLimit":8,"spamScore":7.2}
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 178

{
  "id" : 2,
  "name" : "policyA",
  "quarantine" : true,
  "retention" : false,
  "archive" : false,
  "advertPrefix" : "[ADVERT]",
  "mailSizeLimit" : 8,
  "spamScore" : 7.2
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"name":"policyA","quarantine":true,"retention":false,"archive":false,"advertPrefix":"[ADVERT]","mailSizeLimit":8,"spamScore":7.2}'

4.7.2. Get list of policies

GET /domains/{domainId}/policies
Description

Returns a list of policies of a given domain.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Query

offset
optional

Index of the first domain to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of domains returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< Policy > array

401

Unauthorized

No Content

403

Forbidden

No Content

404

Not Found

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/1/policies HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 374

[ {
  "id" : 1,
  "name" : "Politique-lannister.net",
  "quarantine" : true,
  "retention" : true,
  "archive" : true,
  "advertPrefix" : "[PADOUMBAAA]",
  "mailSizeLimit" : 5,
  "spamScore" : 6.8
}, {
  "id" : 2,
  "name" : "policyB",
  "quarantine" : true,
  "retention" : false,
  "archive" : false,
  "advertPrefix" : "",
  "mailSizeLimit" : 14,
  "spamScore" : 10.0
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.3. Get a policy

GET /domains/{domainId}/policies/{policyId}
Description

Get an existing policy

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Policy

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/policies/3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 187

{
  "id" : 3,
  "name" : "DefaultTestPolicy",
  "quarantine" : true,
  "retention" : false,
  "archive" : true,
  "advertPrefix" : "[ADVERT]",
  "mailSizeLimit" : 6,
  "spamScore" : 7.6
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/policies/3' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.4. Delete a policy

DELETE /domains/{domainId}/policies/{policyId}
Description

Delete an existing policy. Only sysadmin can delete a policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Policy

204

No Content

No Content

400

A problem occured. Possible cause : the policy is affected to a domain or a user.

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Domain or policy not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/1/policies/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/2' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.5. Update a policy

PATCH /domains/{domainId}/policies/{policyId}
Description

Edit properties of an existing policy. Apply changes only on specified fields in request. Attributes which are not provided will not be updated. Only sysadmin can update a policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Body

policy
optional

policy

Policy

Responses
HTTP Code Description Schema

200

OK

Policy

204

No Content

No Content

400

A problem occured. Possible cause : the policy name does not match required format

No Content

401

Unauthorized

No Content

403

Only users with sysadmin role can execute this request.

No Content

404

Domain or policy not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/1/policies/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 18

{"name":"policyC"}
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 180

{
  "id" : 1,
  "name" : "policyC",
  "quarantine" : true,
  "retention" : true,
  "archive" : true,
  "advertPrefix" : "[PADOUMBAAA]",
  "mailSizeLimit" : 5,
  "spamScore" : 6.8
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/1' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"name":"policyC"}'

4.7.6. Get archive properties

GET /domains/{domainId}/policies/{policyId}/archive
Description

Get archive properties of an existing policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Archive

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Archive might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/policies/3/archive HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 213

{
  "duration" : 14,
  "storeMailOut" : false,
  "storeCleanMailIn" : false,
  "storeSpam" : true,
  "storeVirus" : true,
  "storeBadHeaders" : true,
  "storeBadEncoding" : false,
  "storeBadAttachments" : false
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/policies/3/archive' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.7. Set archive properties

PATCH /domains/{domainId}/policies/{policyId}/archive
Description

Set archive properties of an existing policy. Apply changes only on specified fields in request. Attributes which are not provided will not be updated.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Body

archive
optional

archive

Archive

Responses
HTTP Code Description Schema

200

OK

Archive

204

No Content

No Content

400

A problem occured. Possible cause : Parameters do not match required format or archive service is not enabled for this policy

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Archive might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/1/policies/1/archive HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 33

{"duration":80,"storeSpam":false}
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/1/archive' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"duration":80,"storeSpam":false}'

4.7.8. Get quarantine properties

GET /domains/{domainId}/policies/{policyId}/quarantine
Description

Get quarantine properties of an existing policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Quarantine

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Quarantine might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/policies/3/quarantine HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 156

{
  "duration" : 3,
  "storeSpam" : true,
  "storeVirus" : true,
  "storeBadHeaders" : false,
  "storeBadEncoding" : true,
  "storeBadAttachments" : false
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/policies/3/quarantine' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.9. Set quarantine properties

PATCH /domains/{domainId}/policies/{policyId}/quarantine
Description

Set quarantine properties of an existing policy. Apply changes only on specified fields in request. Attributes which are not provided will not be updated.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Body

quarantine
optional

quarantine

Quarantine

Responses
HTTP Code Description Schema

200

OK

Quarantine

204

No Content

No Content

400

A problem occured. Possible cause : Parameters do not match required format or quarantine service is not enabled for this policy

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Quarantine might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/1/policies/1/quarantine HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 60

{"duration":80,"storeSpam":false,"storeBadAttachments":true}
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/1/quarantine' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"duration":80,"storeSpam":false,"storeBadAttachments":true}'

4.7.10. Get relay properties

GET /domains/{domainId}/policies/{policyId}/relay
Description

Get relay properties of an existing policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Relay

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Relay might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/1/policies/2/relay HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 164

{
  "relaySpam" : true,
  "prefixSpam" : "##SPAM##",
  "relayVirus" : false,
  "relayBadHeaders" : true,
  "relayBadAttachments" : false,
  "spamScoreLimit" : 7.3
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/2/relay' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.11. Set relay properties

PATCH /domains/{domainId}/policies/{policyId}/relay
Description

Set relay properties of an existing policy. Apply changes only on specified fields in request. Attributes which are not provided will not be updated.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Body

relay
optional

relay

Relay

Responses
HTTP Code Description Schema

200

OK

Relay

204

No Content

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Relay might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/1/policies/2/relay HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 40

{"relaySpam":true,"prefixSpam":"[SPAM]"}
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/policies/2/relay' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"relaySpam":true,"prefixSpam":"[SPAM]"}'

4.7.12. Get retention properties

GET /domains/{domainId}/policies/{policyId}/retention
Description

Get retention properties of an existing policy.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

Retention

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Retention might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/policies/3/retention HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 76

{
  "duration" : 30,
  "storeMailOut" : false,
  "storeCleanMailIn" : true
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/policies/3/retention' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.7.13. Set retention properties

PATCH /domains/{domainId}/policies/{policyId}/retention
Description

Set retention properties of an existing policy. Apply changes only on specified fields in request. Attributes which are not provided will not be updated.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

policyId
required

policyId

integer(int32)

Body

retention
optional

retention

Retention

Responses
HTTP Code Description Schema

200

OK

Retention

204

No Content

No Content

400

A problem occured. Possible cause : Parameters do not match required format or retention service is not enabled for this policy

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Policy or domain not found with given id. Retention might be disabled on this policy.

No Content

Consumes
  • application/json

Produces
  • application/json

4.8. User-controller

API for users management. A user is attached to an existing domain. You must then first create a domain before creating a user.

4.8.1. Create a new user

POST /domains/{domainId}/users
Description

Create a new user’s account. Return the created user.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

user
optional

user

User

Responses
HTTP Code Description Schema

201

Created

User

400

A problem occured. Possible cause : the account email does not match email format

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

Domain not found with given id

No Content

409

A user may already exists with the given name

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/users HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 136

{"email":"arya@stark.net","firstname":"Arya","lastname":"Stark","status":"ENABLED","language":"EN_GB","password":"Nymeria","domainId":2}
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 217

{
  "id" : 2,
  "email" : "arya@stark.net",
  "firstname" : "Arya",
  "lastname" : "Stark",
  "status" : "ENABLED",
  "language" : "EN_GB",
  "password" : null,
  "domainId" : 2,
  "policyId" : 2,
  "platformId" : 2
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"email":"arya@stark.net","firstname":"Arya","lastname":"Stark","status":"ENABLED","language":"EN_GB","password":"Nymeria","domainId":2}'

4.8.2. Get a list of users

GET /domains/{domainId}/users
Description

Returns the list of users of a given domain.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Query

offset
optional

Index of the first account to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of users returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< User > array

401

Unauthorized

No Content

403

Forbidden

No Content

404

Domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/1/users HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 688

[ {
  "id" : 1,
  "email" : "cersei@lannister.net",
  "firstname" : null,
  "lastname" : null,
  "status" : "ENABLED",
  "language" : "FR_FR",
  "password" : null,
  "domainId" : 1,
  "policyId" : 1,
  "platformId" : 1
}, {
  "id" : 2,
  "email" : "joffrey@lannister.net",
  "firstname" : "Joffrey",
  "lastname" : "Lannister",
  "status" : "DISABLED",
  "language" : "EN_GB",
  "password" : null,
  "domainId" : 1,
  "policyId" : 1,
  "platformId" : 1
}, {
  "id" : 3,
  "email" : "tommen@lannister.net",
  "firstname" : "Tommen",
  "lastname" : "Lannister",
  "status" : "DISABLED",
  "language" : "EN_GB",
  "password" : null,
  "domainId" : 1,
  "policyId" : 1,
  "platformId" : 1
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/users' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.8.3. Get a user

GET /domains/{domainId}/users/{userId}
Description

Get an existing user’s account

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

User

401

Unauthorized

No Content

403

Forbidden

No Content

404

User or domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/users/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 219

{
  "id" : 2,
  "email" : "sansa@stark.net",
  "firstname" : "Sansa",
  "lastname" : "Stark",
  "status" : "ENABLED",
  "language" : "EN_GB",
  "password" : null,
  "domainId" : 2,
  "policyId" : 2,
  "platformId" : 2
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.8.4. Delete a user

DELETE /domains/{domainId}/users/{userId}
Description

Delete an existing user

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

User

204

No Content

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

User or domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/1/users/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/1/users/2' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.8.5. Update a user

PATCH /domains/{domainId}/users/{userId}
Description

Edit properties of an existing user. Apply changes only on specified fields in request. Attributes which are not provided will not be updated. Returns the updated user’s account.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Body

user
optional

user

User

Responses
HTTP Code Description Schema

200

OK

User

204

No Content

No Content

400

A problem occured. Possible cause : the account email does not match email format

No Content

401

Unauthorized

No Content

403

Forbidden

No Content

404

User or domain not found with given id

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
PATCH /domains/2/users/2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 39

{"lastname":"Stark","language":"DE_DE"}
Example HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json
Content-Length: 220

{
  "id" : 2,
  "email" : "john.snow@got.net",
  "firstname" : "John",
  "lastname" : "Stark",
  "status" : "ENABLED",
  "language" : "DE_DE",
  "password" : null,
  "domainId" : 2,
  "policyId" : 2,
  "platformId" : 2
}
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2' -i -u 'cersei@lannister.net:test' -X PATCH -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"lastname":"Stark","language":"DE_DE"}'

4.9. White-list-controller

API for whitelist management. A whitelist depends on a domain or a user.

4.9.1. Add emails or domains to the whitelist of a user.

POST /domains/{domainId}/users/{userId}/whitelist
Description

Add a list of elements to the whitelist of the user. Returns the list of added elements.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Body

whitelist
optional

The list of elements to add to the user’s whitelist. It is possible to whitelist a user or an entire domain.
To whitelist a user please follow this pattern : "user@domain.com".
To whitelist a domain, please follow this pattern : "domain.com".

< string > array

Responses
HTTP Code Description Schema

200

OK

< WBList > array

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

409

This item may already be whiteListed

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/users/2/whitelist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 40

["tyrion@lannister.net","targaryen.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 99

[ {
  "id" : 3,
  "email" : "tyrion@lannister.net"
}, {
  "id" : 4,
  "email" : "targaryen.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/whitelist' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["tyrion@lannister.net","targaryen.net"]'

4.9.2. Get the whitelist of a user

GET /domains/{domainId}/users/{userId}/whitelist
Description

Returns the whitelist of the user

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

userId
required

userId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< WBList > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/users/2/whitelist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 141

[ {
  "id" : 3,
  "email" : "deadguys.fr"
}, {
  "id" : 2,
  "email" : "cersei@alive.fr"
}, {
  "id" : 1,
  "email" : "daenerys@alive.fr"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/whitelist' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.9.3. Delete an element from the whitelist of a user.

DELETE /domains/{domainId}/users/{userId}/whitelist/{itemId}
Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

itemId
required

itemId

integer(int32)

Path

userId
required

userId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

WBList

204

No Content

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the user or the item may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/users/2/whitelist/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/users/2/whitelist/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

4.9.4. Add emails or domains to the whitelist of a domain.

POST /domains/{domainId}/whitelist
Description

Add a list of elements to the whitelist of the domain. Returns the list of added elements.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Body

whitelist
optional

The list of elements to add to the domain’s whitelist. It is possible to whitelist a user or an entire domain.
To whitelist a user please follow this pattern : "user@domain.com".
To whitelist a domain, please follow this pattern : "domain.com".

< string > array

Responses
HTTP Code Description Schema

200

OK

< WBList > array

201

Created

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

409

This item may already be whiteListed

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
POST /domains/2/whitelist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Content-Length: 42

["lannister.net","daenerys@targaryen.net"]
Example HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 101

[ {
  "id" : 3,
  "email" : "lannister.net"
}, {
  "id" : 4,
  "email" : "daenerys@targaryen.net"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/whitelist' -i -u 'cersei@lannister.net:test' -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '["lannister.net","daenerys@targaryen.net"]'

4.9.5. Get the whitelist of a domain

GET /domains/{domainId}/whitelist
Description

Returns the whitelist of the domain.

Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Query

offset
optional

Index of the first group to return, defaults to 0

integer(int32)

Query

pageSize
optional

Maximum number of groups returned, defaults to 40

integer(int32)

"40"

Responses
HTTP Code Description Schema

200

OK

< WBList > array

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
GET /domains/2/whitelist HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 141

[ {
  "id" : 3,
  "email" : "deadguys.fr"
}, {
  "id" : 2,
  "email" : "cersei@alive.fr"
}, {
  "id" : 1,
  "email" : "daenerys@alive.fr"
} ]
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/whitelist' -i -u 'cersei@lannister.net:test' -H 'Content-Type: application/json' -H 'Accept: application/json'

4.9.6. Delete an element from the whitelist of a domain.

DELETE /domains/{domainId}/whitelist/{itemId}
Parameters
Type Name Description Schema Default

Path

domainId
required

domainId

integer(int32)

Path

itemId
required

itemId

integer(int32)

Responses
HTTP Code Description Schema

200

OK

WBList

204

No Content

No Content

401

Unauthorized

No Content

403

You do not have permission to execute this request.

No Content

404

A problem occured. The domain or the item may not exist

No Content

Consumes
  • application/json

Produces
  • application/json

Example HTTP request
DELETE /domains/2/whitelist/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Basic Y2Vyc2VpQGxhbm5pc3Rlci5uZXQ6dGVzdA==
Host: api.mydomain.com
Example HTTP response
HTTP/1.1 204 No Content
Example Curl request
$ curl 'https://api.mydomain.com:8080/domains/2/whitelist/1' -i -u 'cersei@lannister.net:test' -X DELETE -H 'Content-Type: application/json' -H 'Accept: application/json'

5. Definitions

5.1. Alias

Name Description Schema

id
optional
read-only

Idenfier of the alias

integer(int32)

name
required

Name of the alias
Example : "@dev.net"

string

5.2. Archive

Name Description Schema

duration
optional

Number of days the messages are archived
Example : 90

integer(int32)

storeBadAttachments
optional

Determine if system must archive incoming emails with unauthorized file formats
Example : true

boolean

storeBadEncoding
optional

Determine if system must archive incoming emails with bad encoding
Example : true

boolean

storeBadHeaders
optional

Determine if system must archive incoming emails with bad headers
Example : true

boolean

storeCleanMailIn
optional

Determine if system must archive clean incoming emails
Example : true

boolean

storeMailOut
optional

Determine if system must archive sent emails
Example : true

boolean

storeSpam
optional

Determine if system must archive incoming email detected as spams
Example : true

boolean

storeVirus
optional

Determine if system must archive incoming emails which seem to contain a virus
Example : false

boolean

5.3. Domain

Name Description Schema

archive
required

Activation status of archiving service
Example : false

boolean

autoProvisioningOn
required

Activation status of automatic creation of users' accounts
Example : false

boolean

defaultLanguage
required

Default Language of the accounts in this domain
Example : "FR_FR"

enum (FR_FR, EN_GB, DE_DE, ES_ES)

id
optional
read-only

Idenfier of the domain

integer(int32)

name
required

Name of the domain
Example : "alinto.net"

string

platformId
required

Platform’s identifier of the domain
Example : 3

integer(int32)

quarantine
required

Activation status of quarantine service
Example : true

boolean

retention
required

Activation status of retention service
Example : false

boolean

status
required

Activation status of the domain
Example : "ENABLED"

enum (ENABLED, DISABLED)

5.4. Group

Name Description Schema

email
required

Email of the group
Example : "team@test.net"

string

id
optional
read-only

Idenfier of the group

integer(int32)

5.5. MessageCriterias

Name Description Schema

bcc
optional
read-only

The "blind carbon copy" recipient(s) of a message

string

body
optional
read-only

The body of a message

string

cc
optional
read-only

The "carbon copy" recipient(s) of a message

string

folders
optional

The folders path of the messages

< string > array

from
optional
read-only

The author of a message

string

operator
optional
read-only

The operator of the sear ("AND" or "OR")
Example : "AND"

string

receivedafter
optional
read-only

Search the messages received after this date

string(date-time)

receivedbefore
optional
read-only

Search the messages received before this date

string(date-time)

receivedon
optional
read-only

The date the message was received

string(date-time)

subject
optional
read-only

The subject of a mail

string

to
optional
read-only

The recipient of a message

string

5.6. Platform

Name Description Schema

fallbackTransportDest
optional

IP or hostname of the secondary smtp server.
Example : "81.25.142.243"

string

fallbackTransportPort
optional

Port of the secondary smtp server.
Example : 25

integer(int32)

fallbackTransportType
optional

Protocol used to deliever message to the secondary smtp server.
Example : "smtp"

enum (SMTP, SMTPS)

id
optional
read-only

Idenfier of the platform

integer(int32)

name
required

Name of the platform.
Example : "default"

string

transportDest
required

IP or hostname of the main smtp server.
Example : "81.25.142.242"

string

transportPort
required

Port of the main smtp server.
Example : 25

integer(int32)

transportType
required

Protocol used to deliever message to the main smtp server.
Example : "smtp"

enum (SMTP, SMTPS)

5.7. Policy

Name Description Schema

advertPrefix
optional

Prefix added to subject of email detected as adverts. Set an empty string to disable prefixing.
Example : "[AD]"

string

archive
required

Activation status of archiving service
Example : false

boolean

id
optional
read-only

Idenfier of the policy

integer(int32)

mailSizeLimit
optional

Determine mail size limit in MB.
Example : 8

integer(int32)

name
required

Name of the policy.
Example : "default policy"

string

quarantine
required

Activation status of quarantine service
Example : true

boolean

retention
required

Activation status of retention service
Example : false

boolean

spamScore
optional

Score from which a message is treated as a spam.
Example : 8.0

number(float)

5.8. Quarantine

Name Description Schema

duration
optional

Number of days the messages are store in quarantine
Example : 48

integer(int32)

storeBadAttachments
optional

Determine if system must store emails with unauthorized file formats
Example : true

boolean

storeBadEncoding
optional

Determine if system must store emails detected with bad encoding
Example : true

boolean

storeBadHeaders
optional

Determine if system must store emails with bad headers
Example : true

boolean

storeSpam
optional

Determine if system must store spams
Example : true

boolean

storeVirus
optional

Determine if system must store incoming emails which seem to contain a virus
Example : true

boolean

5.9. Relay

Name Description Schema

prefixSpam
optional

Prefix added to subject of email detected as spam. Set an empty string to disable prefixing.
Example : "[SPAM]"

string

relayBadAttachments
optional

Determine if system must deliver incoming emails which contain attachments with unauthorized file extensions (.exe,.zip,…)
Example : false

boolean

relayBadHeaders
optional

Determine if system must deliver incoming emails which contain bad headers.
Example : false

boolean

relaySpam
optional

Determine if system must deliver incoming emails considered as spam.
Example : false

boolean

relayVirus
optional

Determine if system must deliver incoming emails which seem to contain a virus.
Example : false

boolean

spamScoreLimit
optional

Score from which a message considered as spam is not delievered.
Example : 7.0

number(float)

5.10. ReleasedMessage

Name Description Schema

folderPath
optional
read-only

Folder path of an email

string

mailId
optional
read-only

Identifier of an email

integer(int32)

5.11. Retention

Name Description Schema

duration
optional

Number of days the messages are store in retention
Example : 5

integer(int32)

storeCleanMailIn
optional

Determine if system must store clean incoming emails
Example : true

boolean

storeMailOut
optional

Determine if system must store sent emails
Example : true

boolean

5.12. User

Name Description Schema

domainId
required

Domain’s identifier of the account
Example : 2

integer(int32)

email
required

Username of the accoount.
Example : "user@alinto.eu"

string

firstname
optional

Firstname of the user
Example : "John"

string

id
optional
read-only

Idenfier of the user

integer(int32)

language
required

Language of the account
Example : "FR_FR"

enum (FR_FR, EN_GB, DE_DE, ES_ES)

lastname
optional

Lastname of the user
Example : "Doe"

string

password
required

Clear password of the account. This field will be empty in responses of GET requests.

string

platformId
optional

Platform’s identifier of the account. Set 0 to apply the default platform of the domain.
Example : 3

integer(int32)

policyId
optional

Policy’s identifier of the account. Set 0 to apply the default policy of the domain.
Example : 0

integer(int32)

status
required

Activation status of the account
Example : "ENABLED"

enum (ENABLED, DISABLED)

5.13. UserGroup

Name Description Schema

email
required

Username of the accoount.
Example : "user@alinto.eu"

string

firstname
optional

Firstname of the user
Example : "John"

string

id
optional
read-only

Idenfier of the user group

integer(int32)

lastname
optional

Lastname of the user
Example : "Doe"

string

5.14. WBList

Name Description Schema

email
required

Email of the white/blackb list item
Example : "team@test.net ; @domain.net"

string

id
optional
read-only

Idenfier of the white/black list item

integer(int32)