REST API for managing email accounts, message filter rules, and delivery methods in the Apricot Systematic Email Service.
Version: 1.0.0
- basicAuth:
http(in:, name:) - sessionAuth:
apiKey(in:cookie, name:sessionid)
Operation: v1_email_accounts_list
The EmailAccount. This represents an email address active on a server. A user may have multiple EmailAccounts.
NOTE: The EmailAccount can not be created or deleted via the REST API.
Response 200:
Operation: v1_email_accounts_delivery_methods_list
List all delivery methods for the email account.
Parameters:
email_account_pk(path, required)
Response 200:
Operation: v1_email_accounts_delivery_methods_create
Create a new delivery method. Include delivery_type ("LocalDelivery" or "AliasToDelivery") to select the subtype.
Parameters:
email_account_pk(path, required)
Request Body (application/json):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Request Body (application/x-www-form-urlencoded):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Request Body (multipart/form-data):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Response 201:
One of:
LocalDeliveryAliasToDelivery
Operation: v1_email_accounts_delivery_methods_retrieve
Retrieve a specific delivery method.
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this delivery method.
Response 200:
One of:
LocalDeliveryAliasToDelivery
Operation: v1_email_accounts_delivery_methods_update
CRUD + ordering for DeliveryMethod objects nested under an EmailAccount.
Supports LocalDelivery and AliasToDelivery subtypes. The request body
must include a delivery_type field (e.g. "LocalDelivery") to select
the correct subtype serializer on create/update.
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this delivery method.
Request Body (application/json):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Request Body (application/x-www-form-urlencoded):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Request Body (multipart/form-data):
One of:
LocalDeliveryRequestAliasToDeliveryRequest
Response 200:
One of:
LocalDeliveryAliasToDelivery
Operation: v1_email_accounts_delivery_methods_partial_update
CRUD + ordering for DeliveryMethod objects nested under an EmailAccount.
Supports LocalDelivery and AliasToDelivery subtypes. The request body
must include a delivery_type field (e.g. "LocalDelivery") to select
the correct subtype serializer on create/update.
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this delivery method.
Request Body (application/json):
One of:
PatchedLocalDeliveryRequestPatchedAliasToDeliveryRequest
Request Body (application/x-www-form-urlencoded):
One of:
PatchedLocalDeliveryRequestPatchedAliasToDeliveryRequest
Request Body (multipart/form-data):
One of:
PatchedLocalDeliveryRequestPatchedAliasToDeliveryRequest
Response 200:
One of:
LocalDeliveryAliasToDelivery
Operation: v1_email_accounts_delivery_methods_destroy
CRUD + ordering for DeliveryMethod objects nested under an EmailAccount.
Supports LocalDelivery and AliasToDelivery subtypes. The request body
must include a delivery_type field (e.g. "LocalDelivery") to select
the correct subtype serializer on create/update.
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this delivery method.
Response 204: No response body
Operation: v1_email_accounts_message_filter_rules_list
Parameters:
email_account_pk(path, required)
Response 200:
Operation: v1_email_accounts_message_filter_rules_create
MessageFilterRule's are nested objects. The view passes in the required information about the EmailAccount that this MessageFilterRule belongs to. So we need to make sure that this value is set when creating.
Parameters:
email_account_pk(path, required)
Request Body (application/json):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (application/x-www-form-urlencoded):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (multipart/form-data):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Response 201:
url(string) (required, read-only)email_account(string) (required, read-only)header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)order(integer) (required, read-only)created_at(string) (required, read-only)modified_at(string) (required, read-only)
Operation: v1_email_accounts_message_filter_rules_retrieve
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this message filter rule.
Response 200:
url(string) (required, read-only)email_account(string) (required, read-only)header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)order(integer) (required, read-only)created_at(string) (required, read-only)modified_at(string) (required, read-only)
Operation: v1_email_accounts_message_filter_rules_update
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this message filter rule.
Request Body (application/json):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (application/x-www-form-urlencoded):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (multipart/form-data):
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Response 200:
url(string) (required, read-only)email_account(string) (required, read-only)header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)order(integer) (required, read-only)created_at(string) (required, read-only)modified_at(string) (required, read-only)
Operation: v1_email_accounts_message_filter_rules_partial_update
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this message filter rule.
Request Body (application/json):
header(``)pattern(string)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (application/x-www-form-urlencoded):
header(``)pattern(string)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Request Body (multipart/form-data):
header(``)pattern(string)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Response 200:
url(string) (required, read-only)email_account(string) (required, read-only)header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)order(integer) (required, read-only)created_at(string) (required, read-only)modified_at(string) (required, read-only)
Operation: v1_email_accounts_message_filter_rules_destroy
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this message filter rule.
Response 204: No response body
Operation: v1_email_accounts_message_filter_rules_move_create
Process one of the move commands to change the ordering of message filter rules.
Parameters:
email_account_pk(path, required)id(path, required) — A unique integer value identifying this message filter rule.
Request Body (application/json):
command(string) (required) — *up- up
down- downto- tobottom- bottomtop- top Enum: ['up', 'down', 'to', 'bottom', 'top']
location(integer)
Request Body (application/x-www-form-urlencoded):
command(string) (required) — *up- up
down- downto- tobottom- bottomtop- top Enum: ['up', 'down', 'to', 'bottom', 'top']
location(integer)
Request Body (multipart/form-data):
command(string) (required) — *up- up
down- downto- tobottom- bottomtop- top Enum: ['up', 'down', 'to', 'bottom', 'top']
location(integer)
Response 200:
status(string) (required)url(string) (required)order(integer) (required)
Operation: v1_email_accounts_retrieve
The EmailAccount. This represents an email address active on a server. A user may have multiple EmailAccounts.
NOTE: The EmailAccount can not be created or deleted via the REST API.
Parameters:
id(path, required) — A unique integer value identifying this email account.
Response 200:
pk(integer) (required, read-only)created_at(string) (required, read-only)deactivated(boolean) (required, read-only) — If an account is deactivated it can still receive email. However it is no longer allowed to send email. Aliasing to other email accounts is allowed, but no forwarding to an email account not on on the system is allowed.deactivated_reason(string) (required, read-only) — Reason for the account being deactivatedemail_address(string) (required, read-only) — The email address that will receive emails on this server, and the address that will be used as a login to send emails. It must have the same domin name as the associated serverenabled(boolean) (required, read-only) — If an account is not enabled, email for this account will not be accepted. This is equivalent to the email account not existing.message_filter_rules(string) (required, read-only)modified_at(string) (required, read-only)num_bounces(integer) (required, read-only) — Every time this email account sends an email and it results in a bounce this counter will increment. The mail provider does not allow excessive bounced email and this is a check to make sure that does not happen. An asynchronous task will go through all accounts that have a non-zero number of bounces and reduce them by 1 once a day. If you have more than the limit your account will be deactivated until it goes under the limit.owner(string) (required, read-only)server(string) (required, read-only)url(string) (required, read-only)
Operation: v1_email_accounts_update
The EmailAccount. This represents an email address active on a server. A user may have multiple EmailAccounts.
NOTE: The EmailAccount can not be created or deleted via the REST API.
Parameters:
id(path, required) — A unique integer value identifying this email account.
Response 200:
pk(integer) (required, read-only)created_at(string) (required, read-only)deactivated(boolean) (required, read-only) — If an account is deactivated it can still receive email. However it is no longer allowed to send email. Aliasing to other email accounts is allowed, but no forwarding to an email account not on on the system is allowed.deactivated_reason(string) (required, read-only) — Reason for the account being deactivatedemail_address(string) (required, read-only) — The email address that will receive emails on this server, and the address that will be used as a login to send emails. It must have the same domin name as the associated serverenabled(boolean) (required, read-only) — If an account is not enabled, email for this account will not be accepted. This is equivalent to the email account not existing.message_filter_rules(string) (required, read-only)modified_at(string) (required, read-only)num_bounces(integer) (required, read-only) — Every time this email account sends an email and it results in a bounce this counter will increment. The mail provider does not allow excessive bounced email and this is a check to make sure that does not happen. An asynchronous task will go through all accounts that have a non-zero number of bounces and reduce them by 1 once a day. If you have more than the limit your account will be deactivated until it goes under the limit.owner(string) (required, read-only)server(string) (required, read-only)url(string) (required, read-only)
Operation: v1_email_accounts_partial_update
The EmailAccount. This represents an email address active on a server. A user may have multiple EmailAccounts.
NOTE: The EmailAccount can not be created or deleted via the REST API.
Parameters:
id(path, required) — A unique integer value identifying this email account.
Response 200:
pk(integer) (required, read-only)created_at(string) (required, read-only)deactivated(boolean) (required, read-only) — If an account is deactivated it can still receive email. However it is no longer allowed to send email. Aliasing to other email accounts is allowed, but no forwarding to an email account not on on the system is allowed.deactivated_reason(string) (required, read-only) — Reason for the account being deactivatedemail_address(string) (required, read-only) — The email address that will receive emails on this server, and the address that will be used as a login to send emails. It must have the same domin name as the associated serverenabled(boolean) (required, read-only) — If an account is not enabled, email for this account will not be accepted. This is equivalent to the email account not existing.message_filter_rules(string) (required, read-only)modified_at(string) (required, read-only)num_bounces(integer) (required, read-only) — Every time this email account sends an email and it results in a bounce this counter will increment. The mail provider does not allow excessive bounced email and this is a check to make sure that does not happen. An asynchronous task will go through all accounts that have a non-zero number of bounces and reduce them by 1 once a day. If you have more than the limit your account will be deactivated until it goes under the limit.owner(string) (required, read-only)server(string) (required, read-only)url(string) (required, read-only)
Operation: v1_email_accounts_set_password_create
The EmailAccount. This represents an email address active on a server. A user may have multiple EmailAccounts.
NOTE: The EmailAccount can not be created or deleted via the REST API.
Parameters:
id(path, required) — A unique integer value identifying this email account.
Request Body (application/json):
password(string) (required)
Request Body (application/x-www-form-urlencoded):
password(string) (required)
Request Body (multipart/form-data):
password(string) (required)
Response 200:
status(string) (required)
folder- folderdestroy- destroy
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
url(string) (required, read-only)pk(integer) (required, read-only)delivery_type(string) (required, read-only)enabled(boolean) — When disabled, this delivery method is skipped during message delivery.created_at(string) (required, read-only)modified_at(string) (required, read-only)target_account(string) (required) — The EmailAccount messages will be aliased to.
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
enabled(boolean) — When disabled, this delivery method is skipped during message delivery.target_account(string) (required) — The EmailAccount messages will be aliased to.
up- updown- downto- tobottom- bottomtop- top
One of:
LocalDeliveryAliasToDelivery
One of:
LocalDeliveryRequestAliasToDeliveryRequest
pk(integer) (required, read-only)created_at(string) (required, read-only)deactivated(boolean) (required, read-only) — If an account is deactivated it can still receive email. However it is no longer allowed to send email. Aliasing to other email accounts is allowed, but no forwarding to an email account not on on the system is allowed.deactivated_reason(string) (required, read-only) — Reason for the account being deactivatedemail_address(string) (required, read-only) — The email address that will receive emails on this server, and the address that will be used as a login to send emails. It must have the same domin name as the associated serverenabled(boolean) (required, read-only) — If an account is not enabled, email for this account will not be accepted. This is equivalent to the email account not existing.message_filter_rules(string) (required, read-only)modified_at(string) (required, read-only)num_bounces(integer) (required, read-only) — Every time this email account sends an email and it results in a bounce this counter will increment. The mail provider does not allow excessive bounced email and this is a check to make sure that does not happen. An asynchronous task will go through all accounts that have a non-zero number of bounces and reduce them by 1 once a day. If you have more than the limit your account will be deactivated until it goes under the limit.owner(string) (required, read-only)server(string) (required, read-only)url(string) (required, read-only)
addr- addr*- *bcc- bcccc- ccdefault- defaultx-dspam-result- x-dspam-resultfrom- fromreply-to- reply-tosource- sourcex-spam-score- x-spam-scorex-spam-status- x-spam-statussubject- subjectto- to
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
url(string) (required, read-only)pk(integer) (required, read-only)delivery_type(string) (required, read-only)enabled(boolean) — When disabled, this delivery method is skipped during message delivery.created_at(string) (required, read-only)modified_at(string) (required, read-only)maildir_path(string) (required, read-only) — Root folder for the local MH mailbox. Left blank it will be auto-filled from the account's email address when first saved.autofile_spam(boolean) — When enabled, messages above the spam score threshold are automatically filed in the spam delivery folder.spam_delivery_folder(string) — Folder to deliver spam into when autofile_spam is enabled.spam_score_threshold(integer) — Messages with an X-Spam-Score at or above this value are considered spam. 15 is a reasonable default.
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
enabled(boolean) — When disabled, this delivery method is skipped during message delivery.autofile_spam(boolean) — When enabled, messages above the spam score threshold are automatically filed in the spam delivery folder.spam_delivery_folder(string) — Folder to deliver spam into when autofile_spam is enabled.spam_score_threshold(integer) — Messages with an X-Spam-Score at or above this value are considered spam. 15 is a reasonable default.
A type of ModelSerializer that uses hyperlinked relationships with compound keys instead
of primary key relationships. Specifically:
- A 'url' field is included instead of the 'id' field.
- Relationships to other instances are hyperlinks, instead of primary keys.
NOTE: this only works with DRF 3.1.0 and above.
url(string) (required, read-only)email_account(string) (required, read-only)header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)order(integer) (required, read-only)created_at(string) (required, read-only)modified_at(string) (required, read-only)
A type of ModelSerializer that uses hyperlinked relationships with compound keys instead
of primary key relationships. Specifically:
- A 'url' field is included instead of the 'id' field.
- Relationships to other instances are hyperlinks, instead of primary keys.
NOTE: this only works with DRF 3.1.0 and above.
header(``)pattern(string) (required)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
Models that use the "ordered" feature need to expose via the REST API methods for changing their ordering. This is done via the "move" method added to the REST API for that model which takes this serializer
command(string) (required) — *up- up
down- downto- tobottom- bottomtop- top Enum: ['up', 'down', 'to', 'bottom', 'top']
location(integer)
status(string) (required)url(string) (required)order(integer) (required)
Serializer for password change endpoint on the EmailAccount.
password(string) (required)
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
enabled(boolean) — When disabled, this delivery method is skipped during message delivery.target_account(string) — The EmailAccount messages will be aliased to.
One of:
PatchedLocalDeliveryRequestPatchedAliasToDeliveryRequest
Base serializer for DeliveryMethod. The delivery_type field exposes the
concrete subclass name so clients can distinguish LocalDelivery from
AliasToDelivery.
enabled(boolean) — When disabled, this delivery method is skipped during message delivery.autofile_spam(boolean) — When enabled, messages above the spam score threshold are automatically filed in the spam delivery folder.spam_delivery_folder(string) — Folder to deliver spam into when autofile_spam is enabled.spam_score_threshold(integer) — Messages with an X-Spam-Score at or above this value are considered spam. 15 is a reasonable default.
A type of ModelSerializer that uses hyperlinked relationships with compound keys instead
of primary key relationships. Specifically:
- A 'url' field is included instead of the 'id' field.
- Relationships to other instances are hyperlinks, instead of primary keys.
NOTE: this only works with DRF 3.1.0 and above.
header(``)pattern(string)action(string) — *folder- folder
destroy- destroy Enum: ['folder', 'destroy']
destination(string)
status(string) (required)