Update an account

PUT /api/2.0/mail/accounts

Request

Updates an account with the name specified in the request.

Authorization

An API key is a token that you provide when making API calls. Include the token in a header parameter called Authorization.

Example: Authorization: 864FE52C-1C1C-469F-9308-51DAFEFE7436.

Headers

Acceptenum of string

Can be one of: application/json.

Content-Typeenum of string

Can be one of: application/json.

Body

namestring

Account name

emailstring

New account email in the name@domain format

accountstring

New IMAP or POP server login

passwordstring

New IMAP or POP server password

portinteger

New IMAP or POP server port

serverstring

New IMAP or POP server address or IP

smtp_accountstring

New SMTP server login

smtp_passwordstring

New SMTP server password

smtp_portinteger

New SMTP server port

smtp_serverstring

New SMTP server address or IP

smtp_authboolean

Specifies if the authentication is needed for the SMTP server or not

restrictboolean

Specifies if all the mails should be downloaded from the account (false) or not (true). If true, then messages for the last 30 days only will be imported

incoming_encryption_typeinteger

New encryption type for the IMAP or POP server: 0 - None, 1 - SSL, 2 - StartTLS

outcoming_encryption_typeinteger

New encryption type for the SMTP server: 0 - None, 1 - SSL, 2 - StartTLS

auth_type_ininteger

New authentication type for the IMAP or POP server: 0 - None, 1 - Login, 4 - CramMd5, 5 - OAuth2

auth_type_smtpinteger

New authentication type for the SMTP server: 0 - None, 1 - Login, 4 - CramMd5, 5 - OAuth2

Examples

PUT /api/2.0/mail/accounts HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: example.com
curl --request PUT \
  --url https://example.com/api/2.0/mail/accounts \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json'

Responses

200

Updated account

MailboxIdintegerformat: int32
Emailstring
Enabledboolean
Namestring
OAuthConnectionboolean
Signatureobject
MailboxIdintegerformat: int32
Htmlstring
IsActiveboolean
Autoreplyobject
MailboxIdintegerformat: int32
TurnOnboolean
OnlyContactsboolean
TurnOnToDateboolean
FromDatestringformat: date-time
ToDatestringformat: date-time
Subjectstring
Htmlstring
EMailInFolderstring
QuotaErrorboolean
AuthErrorboolean
IsGroupboolean
IsAliasboolean
IsTeamlabMailboxboolean
IsDefaultboolean
IsSharedDomainMailboxboolean
DateCreatedarray of string

401

Unauthorized

Get Help

  • If you have any questions about ONLYOFFICE Workspace, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).