mail

32 endpoints
GET/rest/mail

Get messages in mail folders

Description:

Gets a list of messages from the current user's mailbox folders: Inbox, Sent & Tracked, Drafts, Trash, and Outbox. Each result includes the email ID, sent date, and send status.

Precondition:

None.

Response:

Returns the list of messages across the user's mail folders.

Sorting:

Sort string syntax `FIELD_NAME:ORDER`.

ORDER can be asc or desc.

Sorting options:


FIELD_NAMEDescription
idThe mail ID
dateThe date the mail was sent
statusThe current mail status

Parameters
Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.

senderId
Optional
string

Unique identifier of the user who sent the email.

senderId:in
Optional
string[]

Unique identifier of the user who sent the email. Search for results that match any of the specified values of this parameter. (Recommended request size <= 100)

isRecipient
Optional
boolean

Filter results to include only emails where the current user is a recipient.

read
Optional
boolean

Filter results based on whether the email has been read by the current user.

date
Optional
string

Filter results by the email creation date.

date:gt
Optional
string

Filter emails created after the specified date.

date:gte
Optional
string

Filter emails created on or after the specified date.

date:lt
Optional
string

Filter emails created before the specified date.

date:lte
Optional
string

Filter emails created on or before the specified date.

modified_date
Optional
string

Filter emails by the last modified date of the email.

modified_date:gt
Optional
string

Filter emails modified after the specified date.

modified_date:gte
Optional
string

Filter emails modified on or after the specified date.

modified_date:lt
Optional
string

Filter emails modified before the specified date.

modified_date:lte
Optional
string

Filter emails modified on or before the specified date.

deleted
Optional
boolean

Indicates whether the email has been deleted.

emailPackageId
Optional
string

Filter results by the unique identifier of the email package.

emailPackageId:in
Optional
string[]

Filter results by email package identifiers. Matches any of the specified values.

templateId
Optional
integer

Filter results by the unique identifier of the email template.

templateId:in
Optional
integer[]

Filter results by email template identifiers. Matches any of the specified values.

status
Optional
string[]

Filter results by email status. Accepts a comma-separated list of values.
sent – Successfully delivered to recipients.
draft – Saved but not yet sent.
queued – Waiting to be sent.
error – Failed to send.
self_send – Sent only to the sender (self-copy only).
pending_review – Awaiting DLP or admin approval.
denied – Rejected by a DLP or admin policy.

isPreview
Optional
boolean

Filter results to include only preview emails if set to true.

isUserSent
Optional
boolean

Filter results to include only emails sent by the user if set to true.

bucket
Optional
string

Filter results to emails in the specified mailbox bucket.
inbox – Received emails.
draft – Unsent draft emails.
outgoing – Emails queued or in progress.
sent – Successfully sent emails.
trash – Deleted emails.

returnCustomWebForm
Optional
boolean

Includes emails with custom web forms in the results.

customWebFormOnly
Optional
boolean

Filter results to only include emails with custom web forms.

trackingOnly
Optional
boolean

Filter results to only include emails with tracking access.

approvalRequestOnly
Optional
boolean

Filter results to only include emails with approval requests.

webFormId
Optional
string

Filter results by unique identifier of the email web form.

orderBy
Optional
string

Sort order for the results. Default is id:asc.
Allowed values: id:asc, id:desc, date:asc, date:desc, status:asc, status:desc.

sharedMailboxId
Optional
string

Unique identifier of the shared mailbox. Filters results to emails belonging to the shared mailbox.

limit
Optional
integer

Range limit.

offset
Optional
integer

Range offset.


Responses

Messages returned successfully.

id
string

Unique identifier of the email.

senderId
string

Unique identifier of the sender.

templateId
integer

Unique identifier of the email template used.

status
string

Current status of the email (e.g., sent, draft, error, etc.).

type
string

Type of the email (e.g., original, reply, forward, etc.).

date
string

Date the email was last modified or sent.

deleted
boolean

Indicates if the email has been deleted.

withdrawnDate
string

Date when the email was withdrawn, if applicable.

emailPackageId
string

Unique identifier of the associated email package.

isPreview
boolean

Indicates whether the email is a view-only version, typically used for previewing attachments without enabling downloading.

isUserSent
boolean

Indicates whether the email was sent by the current user or another user.

watermark
string

Text watermark applied to the email attachments (applicable only for view-only version).

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

secureBody
boolean

Indicates if the email body is secured.

modifiedDate
string

Date the email was last modified.

parentEmailId
string

Unique identifier of the parent email, if applicable.

userId
string

Unique identifier of the user who requested the return receipt.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

error
string

Error message associated with the email, if any.

subject
string

Subject line of the email.

attachmentCount
integer

Number of attachments in the email.

expirationDate
string

Expiration date of the email package, if applicable.

avStatus
string

Antivirus (AV) scan status of the email.

dlpStatus
string

Data Loss Prevention (DLP) scan status of the email.

hasTrackingAccess
boolean

Indicates if tracking access is enabled for the email.

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

revoked
boolean

Indicates whether the recipient's tracking access has been revoked.

policyDirective
integer

Indicates the restriction type applied to the email

isRead
boolean

Indicates if the email has been read.

bucket
string

The bucket where the email is stored. (e.g. inbox, sent, trash)

body
string

The body of the email.

id
string

Unique identifier of the email package.

selfCopy
boolean

Indicates whether the package includes a copy for the sender.

includeFingerprint
boolean

Indicates whether a fingerprint (hash) of the package should be included for verification.

expire
integer

Expiration time of the package in seconds from creation.

fileCount
any

Count of the files attached to the package.

deleted
boolean

Indicates whether the package has been marked as deleted.

acl
string

Access control list (ACL) associated with the package, specifying who can access it.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

drmFile
object

Details of the DRM-protected file associated with the attachment.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

tags
Tag[]

List of tags associated with the attachment.

permissions
Permission[]

List of permissions associated with the attachment.

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

fingerprints
Fingerprint[]

List of alternative fingerprints for the attachment file.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

downloadLink
string

Link for accessing the email.

rawBody
string

Raw email body content without HTML markup.

headline
string

Headline or main title of the email.

notice
string

Notice part of the email.

fullHtmlBody
string

Full HTML body of the email.

emailFrom
string

The email address from which the email was sent.

templateBody
string

Body content generated from the email template.

webFormId
string

Unique identifier of the web form associated with the email.

webFormFields
any

Fields included in the associated web form with the mail.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

sharedMailboxId
string

Unique identifier of the shared mailbox, if applicable.

htmlBody
string

HTML version of the email body.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

darkModeStyle
string

CSS styles applied for dark mode.

exists
boolean

Indicates whether the email already exists in the system.

total
integer

Total number of items available.

limit
integer

Maximum number of items returned per page.

offset
integer

Number of items skipped before the current page.

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "data": [ { "id": "string", "senderId": "string", "templateId": 1, "status": "string", "type": "string", "date": "2024-01-15" } ], "metadata": { "total": 1, "limit": 1, "offset": 1 } }
// Error - No Body
DELETE/rest/mail

Delete draft messages

Description:

Using email IDs, deletes up to 100 draft messages from the current user's Drafts folder.

Precondition:

None.

Response:

Deletes the specified draft messages from the Drafts folder.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Email messages deleted successfully.

Empty response body.

Some email messages were deleted successfully while others failed.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER, ERR_ENTITY_EMAIL_IS_SENT, ERR_PROFILE_MAIL_DISABLED, ERR_ENTITY_DELETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X DELETE \
  "https://{instance}.kiteworks.com/rest/mail?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.delete(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_SENT", "message": "Email can no longer be deleted" } ] }
{ "errors": [ { "code": "ERR_PROFILE_MAIL_DISABLED", "message": "User's profile has no mail access" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
// Error - No Body
GET/rest/mail/actions/counters

Get message counts for mail folders

Description:

Gets the number of messages in each of the current user's mailbox folders: Inbox, Sent & Tracked, Drafts, Trash, and Outbox.

Precondition:

None.

Response:

Returns the message count for each mail folder.
Parameters
Query Parameters
returnCustomWebForm
Optional
boolean

Indicates whether to include emails with custom web forms in the result.


Responses

Message counts returned successfully.

draft
integer

Number of draft emails.

inbox
integer

Number of emails in the inbox.

inboxUnread
integer

Number of unread emails in the inbox.

outgoing
integer

Number of outgoing emails.

outgoingError
integer

Number of outgoing emails that encountered an error.

outgoingQueued
integer

Number of outgoing emails queued for sending.

outgoingTransferring
integer

Number of outgoing emails currently being transferred.

outgoingTransferringIds
string[]
trash
integer

Number of emails in the trash.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/actions/counters" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/counters"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "draft": 1, "inbox": 1, "inboxUnread": 1, "outgoing": 1, "outgoingError": 1, "outgoingQueued": 1 }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
// Error - No Body
PATCH/rest/mail/actions/deletePermanent

Permanently delete messages

Description:

Using email IDs, permanently deletes messages from the current user's Inbox and Sent folders. Depending on the system retention policy, messages may be recoverable until they are permanently purged by the system.

Preconditions:

Must be the sender or a recipient of the messages.

Response:

Returns a full or partial success response indicating which messages were permanently deleted.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Messages permanently deleted successfully.

Empty response body.

Partially successful — some messages could not be permanently deleted.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_NOT_DELETED, ERR_ENTITY_EMAIL_IS_NOT_COMPLETED

code
string

Error code

message
string

Error message

Gone

Possible error codes: ERR_ENTITY_DELETED_PERMANENTLY

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PATCH \
  "https://{instance}.kiteworks.com/rest/mail/actions/deletePermanent?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/deletePermanent"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.patch(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_NOT_DELETED", "message": "Entity is not deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_NOT_COMPLETED", "message": "Email is not completed" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED_PERMANENTLY", "message": "Entity is deleted permanently" } ] }
// Error - No Body
GET/rest/mail/actions/distributionList

Expand a distribution list

Resolves a distribution list email address and returns its members.

Parameters
Query Parameters
email
Required
string

The email address to check or expand.

expand
Optional
boolean

Indicates whether to include the email addresses of distribution list members.

emailId
Optional
string

If provided, the distribution list will include only members who have received this specific email.


Responses

Returns the distribution list with its resolved member email addresses.

isDistributionList
Required
boolean

Indicates whether the email belongs to a distribution list

members
string[]

List of members in the distribution list

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/actions/distributionList?email=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/distributionList"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "email": "VALUE",
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Responses
{ "isDistributionList": true, "members": [ "engineering@example.com", "design@example.com" ] }
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
PATCH/rest/mail/actions/read

Mark messages as read

Description:

Using email IDs, marks the specified messages as read in the current user's Inbox.

Preconditions:

Must be the sender or a recipient of the messages.

Response:

Returns a full or partial success response indicating which messages were marked as read.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Email messages marked as read successfully.

Empty response body.

Partially successful — some messages could not be marked as read.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PATCH \
  "https://{instance}.kiteworks.com/rest/mail/actions/read?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/read"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.patch(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
// Error - No Body
PATCH/rest/mail/actions/recover

Recover deleted messages

Description:

Using email IDs, recovers deleted messages from the current user's Trash folder and returns them to the Inbox.

Preconditions:

Must be the sender or a recipient of the messages.

Response:

Returns a full or partial success response indicating which messages were recovered to the Inbox.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Messages recovered successfully.

Empty response body.

Partially successful — some messages could not be recovered.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_NOT_DELETED, ERR_ENTITY_EMAIL_IS_NOT_COMPLETED

code
string

Error code

message
string

Error message

Gone

Possible error codes: ERR_ENTITY_DELETED_PERMANENTLY

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PATCH \
  "https://{instance}.kiteworks.com/rest/mail/actions/recover?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/recover"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.patch(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_NOT_DELETED", "message": "Entity is not deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_NOT_COMPLETED", "message": "Email is not completed" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED_PERMANENTLY", "message": "Entity is deleted permanently" } ] }
// Error - No Body
POST/rest/mail/actions/sendFile

Send files

Description:

Creates an email message and sends the specified file attachments through Kiteworks.

Precondition:

Must be assigned a user profile with permission to send mail.

Response:

Returns the created email and sends the file attachments to the specified recipients.
Parameters
Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.


Request Body
to
string[]

List of recipients' email addresses (To field).

cc
string[]

List of recipients' email addresses (CC field).

bcc
string[]

List of recipients' email addresses (BCC field).

files
string[]

List of file UUIDs to attach to the email.

acl
string

Defines the access control level for the email.
verify_recipient – Accessible only to specified recipients.
no_auth – Public access, no authentication required.
otp – Accessible to recipients; allows one-time passcode (OTP) via SMS for authentication.
internal – Accessible to recipients and users within the organization.
anyone_auth – Accessible to recipients and any authenticated user.
email_otp – Accessible to recipients; allows one-time passcode (OTP) via email for authentication.

expire
string

The expiration date of the email.

draft
boolean

Indicates if the email is being saved as a draft.

preview
boolean

Indicates if the email is a view-only version.

watermark
string

Text watermark applied to the email attachments (only applicable when preview is enabled).

secureBody
boolean

If true, the email body is hidden from the notification email and is only visible to authenticated recipients when they open the secure link.

selfCopy
boolean

Indicates if the sender should receive a copy of the email.

includeFingerprint
boolean

If true, a cryptographic hash (fingerprint) of each attached file is included in the notification email, allowing recipients to verify file integrity.

parentEmailId
string

The parent email ID used for email threading. Applicable only for forward or reply types.

isSelfReturnReceipt
boolean

(Deprecated) Send download notification to the sender. Use 'returnReceipts' instead.

returnReceipts
string[]

List of recipients who should receive a download notification.

type
string

The type of email. Defaults to original.
original – A new email.
forward – Forwarding an existing email to new recipients.
reply – A reply to an existing email.
resend – Resending a previously sent email.

uploading
boolean

Indicates whether file upload is still in progress. Prevents sending if set to true.

body
string

The body content of the email.

subject
string

The subject of the email (maximum length: 998 characters).

webFormId
string

The web form ID associated with the email.

webFormFields
object

Custom web form fields associated with the email.

notifyExpired
boolean

Indicates whether to send a notification email to the sender when the email expires.

sharedMailboxId
string

UUID of the shared mailbox to send from. When set, the email is sent on behalf of the shared mailbox rather than the individual user.

trackingAccess
string[]

List of email addresses to grant access to the email's download tracking dashboard.


Responses

Email created successfully.

id
string

Unique identifier of the email.

senderId
string

Unique identifier of the sender.

templateId
integer

Unique identifier of the email template used.

status
string

Current status of the email (e.g., sent, draft, error, etc.).

type
string

Type of the email (e.g., original, reply, forward, etc.).

date
string

Date the email was last modified or sent.

deleted
boolean

Indicates if the email has been deleted.

withdrawnDate
string

Date when the email was withdrawn, if applicable.

emailPackageId
string

Unique identifier of the associated email package.

isPreview
boolean

Indicates whether the email is a view-only version, typically used for previewing attachments without enabling downloading.

isUserSent
boolean

Indicates whether the email was sent by the current user or another user.

watermark
string

Text watermark applied to the email attachments (applicable only for view-only version).

variable
string

The variable name

value
any

The variable value

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

secureBody
boolean

Indicates if the email body is secured.

modifiedDate
string

Date the email was last modified.

parentEmailId
string

Unique identifier of the parent email, if applicable.

userId
string

Unique identifier of the user who requested the return receipt.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

error
string

Error message associated with the email, if any.

subject
string

Subject line of the email.

attachmentCount
integer

Number of attachments in the email.

expirationDate
string

Expiration date of the email package, if applicable.

avStatus
string

Antivirus (AV) scan status of the email.

dlpStatus
string

Data Loss Prevention (DLP) scan status of the email.

hasTrackingAccess
boolean

Indicates if tracking access is enabled for the email.

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

revoked
boolean

Indicates whether the recipient's tracking access has been revoked.

policyDirective
integer

Indicates the restriction type applied to the email

isRead
boolean

Indicates if the email has been read.

bucket
string

The bucket where the email is stored. (e.g. inbox, sent, trash)

body
string

The body of the email.

id
string

Unique identifier of the email package.

selfCopy
boolean

Indicates whether the package includes a copy for the sender.

includeFingerprint
boolean

Indicates whether a fingerprint (hash) of the package should be included for verification.

expire
integer

Expiration time of the package in seconds from creation.

fileCount
any

Count of the files attached to the package.

deleted
boolean

Indicates whether the package has been marked as deleted.

acl
string

Access control list (ACL) associated with the package, specifying who can access it.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

name
string

Name of the DRM-protected file.

size
integer

Size of the DRM-protected file in bytes.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

downloadLink
string

Link for accessing the email.

rawBody
string

Raw email body content without HTML markup.

headline
string

Headline or main title of the email.

notice
string

Notice part of the email.

fullHtmlBody
string

Full HTML body of the email.

emailFrom
string

The email address from which the email was sent.

templateBody
string

Body content generated from the email template.

webFormId
string

Unique identifier of the web form associated with the email.

webFormFields
any

Fields included in the associated web form with the mail.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

sharedMailboxId
string

Unique identifier of the shared mailbox, if applicable.

htmlBody
string

HTML version of the email body.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

darkModeStyle
string

CSS styles applied for dark mode.

exists
boolean

Indicates whether the email already exists in the system.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_IS_DELETED_ATTACHMENT, ERR_ENTITY_IS_SECURE_FOLDER, ERR_INPUT_EMAIL_WITH_NO_RECIPIENTS_NOT_ALLOWED, ERR_INPUT_SECURE_BODY_WITH_NO_AUTH_NOT_ALLOWED, ERR_PROFILE_INCLUDE_FINGERPRINT_DISABLED, ERR_PROFILE_INCLUDE_FINGERPRINT_ENABLED, ERR_PROFILE_RETURN_RECEIPT_DISABLED, ERR_PROFILE_RETURN_RECEIPT_ENABLED, ERR_PROFILE_SECURE_EMAIL_DISABLED, ERR_PROFILE_SELF_COPY_DISABLED, ERR_PROFILE_SELF_COPY_ENABLED, ERR_PROFILE_SEND_FILE_EXTERNAL_DISABLED, ERR_USER_HAS_NO_USER_TYPE, ERR_USER_TYPE_NO_ACCESS

code
string

Error code

message
string

Error message

Unprocessable Content

Possible error codes: ERR_INPUT_EXCEEDS_MAX_VALUE, ERR_INPUT_HYPERLINK, ERR_INPUT_INVALID_DATE, ERR_INPUT_PAST_DATE, ERR_INVALID_PARAMETER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X POST \
  "https://{instance}.kiteworks.com/rest/mail/actions/sendFile" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
         "to": [
         "string"
       ],
         "cc": [
         "string"
       ],
         "bcc": [
         "string"
       ],
         "files": [
         "string"
       ],
         "acl": "verify_recipient",
         "expire": "2024-01-15"
       }'
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/sendFile"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
  "to": [
  "string"
],
  "cc": [
  "string"
],
  "bcc": [
  "string"
],
  "files": [
  "string"
],
  "acl": "verify_recipient",
  "expire": "2024-01-15"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Responses
{ "id": "string", "senderId": "string", "templateId": 1, "status": "string", "type": "string", "date": "2024-01-15" }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_DELETED_ATTACHMENT", "message": "Requested Attachment(s) is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_SECURE_FOLDER", "message": "Operation not permitted on restricted Folder." } ] }
{ "errors": [ { "code": "ERR_INPUT_EMAIL_WITH_NO_RECIPIENTS_NOT_ALLOWED", "message": "The mail cannot be sent without any recipients" } ] }
{ "errors": [ { "code": "ERR_INPUT_SECURE_BODY_WITH_NO_AUTH_NOT_ALLOWED", "message": "Email message body cannot be secured if email does not require authentication" } ] }
{ "errors": [ { "code": "ERR_PROFILE_INCLUDE_FINGERPRINT_DISABLED", "message": "This profile is not allowed to include fingerprint with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_INCLUDE_FINGERPRINT_ENABLED", "message": "This profile cannot disable including fingerprint with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_RETURN_RECEIPT_DISABLED", "message": "This profile is not allowed to set receipt notification with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_RETURN_RECEIPT_ENABLED", "message": "This profile cannot disable return receipt notification with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SECURE_EMAIL_DISABLED", "message": "This profile is not allowed to send secure emails" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SELF_COPY_DISABLED", "message": "This profile is not allowed to send copy to self" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SELF_COPY_ENABLED", "message": "Cannot disable self copy for this profile" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SEND_FILE_EXTERNAL_DISABLED", "message": "This profile is not allowed to send files to external users" } ] }
{ "errors": [ { "code": "ERR_USER_HAS_NO_USER_TYPE", "message": "User has no profile" } ] }
{ "errors": [ { "code": "ERR_USER_TYPE_NO_ACCESS", "message": "Permission denied" } ] }
{ "errors": [ { "code": "ERR_INPUT_EXCEEDS_MAX_VALUE", "message": "Field value exceeds maximum allowed value" } ] }
{ "errors": [ { "code": "ERR_INPUT_HYPERLINK", "message": "Not allowed hyperlink domain. Hyperlink domain should not different from anchored text domain." } ] }
{ "errors": [ { "code": "ERR_INPUT_INVALID_DATE", "message": "The input is not a valid date." } ] }
{ "errors": [ { "code": "ERR_INPUT_PAST_DATE", "message": "Field value should be future date" } ] }
{ "errors": [ { "code": "ERR_INVALID_PARAMETER", "message": "Invalid Parameter Exception" } ] }
// Error - No Body
PATCH/rest/mail/actions/trash

Move messages to Trash

Description:

Using email IDs, moves messages from the current user's Inbox and Sent folders to the Trash folder.

Preconditions:

Must be the sender or a recipient of the messages.

Response:

Returns a full or partial success response indicating which messages were moved to Trash.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Messages moved to Trash successfully.

Empty response body.

Partially successful — some messages could not be moved to Trash.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_EMAIL_IS_NOT_COMPLETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PATCH \
  "https://{instance}.kiteworks.com/rest/mail/actions/trash?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/trash"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.patch(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_NOT_COMPLETED", "message": "Email is not completed" } ] }
// Error - No Body
PATCH/rest/mail/actions/unread

Mark messages as unread

Description:

Using email IDs, marks the specified messages as unread in the current user's Inbox.

Preconditions:

Must be the sender or a recipient of the messages.

Response:

Returns a full or partial success response indicating which messages were marked as unread.
Parameters
Query Parameters
emailId:in
Required
string[]

Comma-separated list of email IDs to be processed.

partialSuccess
Optional
boolean

If set to true, the operation will continue for the valid items even if some items result in failure.


Responses

Email messages marked as unread successfully.

Empty response body.

Partially successful — some messages could not be marked as unread.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PATCH \
  "https://{instance}.kiteworks.com/rest/mail/actions/unread?emailId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/unread"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "emailId:in": "VALUE",
}
response = requests.patch(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
// Error - No Body
GET/rest/mail/{emailId}/attachments/actions/zip

Download email attachments in ZIP format

Using email IDs, downloads a set of email attachments in ZIP format from your Inbox and Sent folders.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email for downloading attachments as a ZIP file.

Query Parameters
attachmentId:in
Required
string

The unique identifier of the attachment.. Search for results that match any of the specified values for this parameter.

name
Optional
string

The name of the ZIP file.

ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).

username
Optional
string

The email address of the user requesting the file.

utcOffset
Optional
integer

The user's timezone offset in seconds. For example, UTC+08:00 = 28800 seconds.

mode
Optional
string

Determines the detail level of the response body.


Responses

Returns the selected email attachments as a ZIP archive.

Empty response body.

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/actions/zip?attachmentId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email for downloading attachments as a ZIP file.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/actions/zip"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "attachmentId:in": "VALUE",
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{emailId}/attachments/actions/zipStatus

Get email attachment security status

Using email IDs, gets the security scan results of email attachments in your Inbox and Sent folders, prior to downloading in ZIP format.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email.

Query Parameters
attachmentId:in
Required
string

The unique identifier of the attachment.. Search for results that match any of the specified values for this parameter.

ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).

mode
Optional
string

Determines the detail level of the response body.


Responses

All specified attachments passed security checks and are safe to download. No content is returned.

Empty response body.

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/actions/zipStatus?attachmentId:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/actions/zipStatus"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "attachmentId:in": "VALUE",
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{emailId}/attachments/report

Get email attachment download report

Returns a download tracking report for the specified email, listing all recorded download and interaction events for its attachments.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email.


Responses

Returns the download tracking report for the specified email.

created_time
integer

Unix timestamp of when the event occurred.

event_name
string

The name of the event action (e.g. download_email, view_file, copy_file, file_withdrawn).

username
string

Email address of the user who performed the action.

successful
boolean

Indicates whether the action was completed successfully.

withdrawn
boolean

Indicates whether the attachment was withdrawn at the time of the event.

file_id
string

The unique identifier of the attachment file. Present only when the event is associated with a specific file.

file_name
string

The name of the attachment file. Present only when the event is associated with a specific file.

event_type
string

A secondary classification of the event type. Present only when applicable.

sent_time
integer

Unix timestamp of when the email was sent.

subject
string

Subject line of the email.

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/report" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/report"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "downloads": [ { "created_time": 1720000000, "event_name": "download_email", "username": "recipient@example.com", "successful": true, "withdrawn": false, "file_id": "att12345abc67890de", "file_name": "Q2_Report.pdf" } ], "sent_time": 1719900000, "subject": "Q2 Reports" }
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{emailId}/attachments/reportCsv

Export email attachment download report as CSV

Generates a download tracking report for the specified email and returns it as a CSV file.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email.


Responses

Returns the download tracking report as a CSV file attachment.

Empty response body.

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/reportCsv" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/reportCsv"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{emailId}/attachments/{id}/content

Download email attachment

Downloads the specified file attached to a message.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email containing the attachment.

id
Required
string

The unique identifier of the attachment.

Query Parameters
ref
Optional
string

The reference code for the email. Required if the email can be accessed without authentication.

mode
Optional
string

Determines the detail level of the response body.

Header Parameters
Range
Optional
string

Range of bytes to download. e.g. bytes=0-1024


Responses

Returns the binary content of the attachment file. Responds with HTTP 206 Partial Content when a Range header is included in the request.

Empty response body.

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/:id/content" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email containing the attachment.
id = "VALUE"  # The unique identifier of the attachment.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/{id}/content"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{emailId}/attachments/{id}/preview

Get email attachment preview metadata

Gets file preview metadata about an email attachment, such as the permalink for previewing the file and if the file contains a watermark. Must be assigned the view permission for the file.

Parameters
Path Parameters
emailId
Required
string

The unique identifier of the email containing the attachment.

id
Required
string

The unique identifier of the attachment.

Query Parameters
ref
Optional
string

The reference code for the email. Required if the email can be accessed without authentication.

mode
Optional
string

Determines the detail level of the response body.


Responses

Returns the preview metadata for the specified attachment, including the URL to render the preview.

link
string

Preview link for the file

pdf
string

PDF file for the preview

viewUrl
string

URL for viewing the preview

status
string

Preview processing status. Accepted values: processing, preview, failed

type
string

Format of the generated preview, such as image or PDF

metadata
string

Additional metadata about the preview, such as dimensions or page count

mime
string

MIME type of the preview file

native
boolean

Indicates whether the preview is a native render

watermark
string

Watermark applied to the preview

tdfOriginalExtension
string

Original file extension for TDF files

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:emailId/attachments/:id/preview" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

emailId = "VALUE"  # The unique identifier of the email containing the attachment.
id = "VALUE"  # The unique identifier of the attachment.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{emailId}/attachments/{id}/preview"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "link": "/preview/abc12345def67890ab", "viewUrl": "https://<YOUR_INSTANCE_DOMAIN>/viewer/abc12345def67890ab", "status": "Preview", "watermark": null }
{ "errors": { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } }
// Error - No Body
GET/rest/mail/{id}

Get email metadata

Description:

Gets the metadata for a specified email message, including subject, sender, recipients, sent date, and attachment details.

Preconditions:

None.

Response:

Returns the email metadata.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.

ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).

print_flag
Optional
boolean

Indicates whether the user clicked to print the email.


Responses

Email metadata returned successfully.

id
string

Unique identifier of the email.

senderId
string

Unique identifier of the sender.

templateId
integer

Unique identifier of the email template used.

status
string

Current status of the email (e.g., sent, draft, error, etc.).

type
string

Type of the email (e.g., original, reply, forward, etc.).

date
string

Date the email was last modified or sent.

deleted
boolean

Indicates if the email has been deleted.

withdrawnDate
string

Date when the email was withdrawn, if applicable.

emailPackageId
string

Unique identifier of the associated email package.

isPreview
boolean

Indicates whether the email is a view-only version, typically used for previewing attachments without enabling downloading.

isUserSent
boolean

Indicates whether the email was sent by the current user or another user.

watermark
string

Text watermark applied to the email attachments (applicable only for view-only version).

variable
string

The variable name

value
any

The variable value

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

secureBody
boolean

Indicates if the email body is secured.

modifiedDate
string

Date the email was last modified.

parentEmailId
string

Unique identifier of the parent email, if applicable.

userId
string

Unique identifier of the user who requested the return receipt.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

error
string

Error message associated with the email, if any.

subject
string

Subject line of the email.

attachmentCount
integer

Number of attachments in the email.

expirationDate
string

Expiration date of the email package, if applicable.

avStatus
string

Antivirus (AV) scan status of the email.

dlpStatus
string

Data Loss Prevention (DLP) scan status of the email.

hasTrackingAccess
boolean

Indicates if tracking access is enabled for the email.

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

revoked
boolean

Indicates whether the recipient's tracking access has been revoked.

policyDirective
integer

Indicates the restriction type applied to the email

isRead
boolean

Indicates if the email has been read.

bucket
string

The bucket where the email is stored. (e.g. inbox, sent, trash)

body
string

The body of the email.

id
string

Unique identifier of the email package.

selfCopy
boolean

Indicates whether the package includes a copy for the sender.

includeFingerprint
boolean

Indicates whether a fingerprint (hash) of the package should be included for verification.

expire
integer

Expiration time of the package in seconds from creation.

fileCount
any

Count of the files attached to the package.

deleted
boolean

Indicates whether the package has been marked as deleted.

acl
string

Access control list (ACL) associated with the package, specifying who can access it.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

name
string

Name of the DRM-protected file.

size
integer

Size of the DRM-protected file in bytes.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

downloadLink
string

Link for accessing the email.

rawBody
string

Raw email body content without HTML markup.

headline
string

Headline or main title of the email.

notice
string

Notice part of the email.

fullHtmlBody
string

Full HTML body of the email.

emailFrom
string

The email address from which the email was sent.

templateBody
string

Body content generated from the email template.

webFormId
string

Unique identifier of the web form associated with the email.

webFormFields
any

Fields included in the associated web form with the mail.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

sharedMailboxId
string

Unique identifier of the shared mailbox, if applicable.

htmlBody
string

HTML version of the email body.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

darkModeStyle
string

CSS styles applied for dark mode.

exists
boolean

Indicates whether the email already exists in the system.

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "id": "string", "senderId": "string", "templateId": 1, "status": "string", "type": "string", "date": "2024-01-15" }
// Error - No Body
DELETE/rest/mail/{id}

Delete a draft message

Description:

Deletes a single message from the current user's Drafts folder.

Preconditions:

None.

Response:

Removes the draft message from the Drafts folder.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.


Responses

Draft email deleted successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER, ERR_ENTITY_EMAIL_IS_SENT, ERR_PROFILE_MAIL_DISABLED, ERR_ENTITY_DELETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X DELETE \
  "https://{instance}.kiteworks.com/rest/mail/:id" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.delete(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_SENT", "message": "Email can no longer be deleted" } ] }
{ "errors": [ { "code": "ERR_PROFILE_MAIL_DISABLED", "message": "User's profile has no mail access" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
// Error - No Body
PUT/rest/mail/{id}/actions/sendFile

Update and send a draft message

Description:

Updates the content of an existing draft message and sends it to its recipients.

Precondition:

Must be assigned a user profile with permission to send mail.

Response:

Returns the updated email and sends the message to the specified recipients.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.


Request Body
to
string[]

List of recipients' email addresses (To field).

cc
string[]

List of recipients' email addresses (CC field).

bcc
string[]

List of recipients' email addresses (BCC field).

files
string[]

List of file UUIDs to attach to the email.

acl
string

Defines the access control level for the email.
verify_recipient – Accessible only to specified recipients.
no_auth – Public access, no authentication required.
otp – Accessible to recipients; allows one-time passcode (OTP) via SMS for authentication.
internal – Accessible to recipients and users within the organization.
anyone_auth – Accessible to recipients and any authenticated user.
email_otp – Accessible to recipients; allows one-time passcode (OTP) via email for authentication.

expire
string

The expiration date of the email.

draft
boolean

Indicates if the email is being saved as a draft.

preview
boolean

Indicates if the email is a view-only version.

watermark
string

Text watermark applied to the email attachments (only applicable when preview is enabled).

secureBody
boolean

If true, the email body is hidden from the notification email and is only visible to authenticated recipients when they open the secure link.

selfCopy
boolean

Indicates if the sender should receive a copy of the email.

includeFingerprint
boolean

If true, a cryptographic hash (fingerprint) of each attached file is included in the notification email, allowing recipients to verify file integrity.

parentEmailId
string

The parent email ID used for email threading. Applicable only for forward or reply types.

isSelfReturnReceipt
boolean

(Deprecated) Send download notification to the sender. Use 'returnReceipts' instead.

returnReceipts
string[]

List of recipients who should receive a download notification.

type
string

The type of email. Defaults to original.
original – A new email.
forward – Forwarding an existing email to new recipients.
reply – A reply to an existing email.
resend – Resending a previously sent email.

uploading
boolean

Indicates whether file upload is still in progress. Prevents sending if set to true.

body
string

The body content of the email.

subject
string

The subject of the email (maximum length: 998 characters).

webFormId
string

The web form ID associated with the email.

webFormFields
object

Custom web form fields associated with the email.

notifyExpired
boolean

Indicates whether to send a notification email to the sender when the email expires.

sharedMailboxId
string

UUID of the shared mailbox to send from. When set, the email is sent on behalf of the shared mailbox rather than the individual user.

trackingAccess
string[]

List of email addresses to grant access to the email's download tracking dashboard.


Responses

Draft email updated and sent successfully.

id
string

Unique identifier of the email.

senderId
string

Unique identifier of the sender.

templateId
integer

Unique identifier of the email template used.

status
string

Current status of the email (e.g., sent, draft, error, etc.).

type
string

Type of the email (e.g., original, reply, forward, etc.).

date
string

Date the email was last modified or sent.

deleted
boolean

Indicates if the email has been deleted.

withdrawnDate
string

Date when the email was withdrawn, if applicable.

emailPackageId
string

Unique identifier of the associated email package.

isPreview
boolean

Indicates whether the email is a view-only version, typically used for previewing attachments without enabling downloading.

isUserSent
boolean

Indicates whether the email was sent by the current user or another user.

watermark
string

Text watermark applied to the email attachments (applicable only for view-only version).

variable
string

The variable name

value
any

The variable value

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

secureBody
boolean

Indicates if the email body is secured.

modifiedDate
string

Date the email was last modified.

parentEmailId
string

Unique identifier of the parent email, if applicable.

userId
string

Unique identifier of the user who requested the return receipt.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

error
string

Error message associated with the email, if any.

subject
string

Subject line of the email.

attachmentCount
integer

Number of attachments in the email.

expirationDate
string

Expiration date of the email package, if applicable.

avStatus
string

Antivirus (AV) scan status of the email.

dlpStatus
string

Data Loss Prevention (DLP) scan status of the email.

hasTrackingAccess
boolean

Indicates if tracking access is enabled for the email.

userId
string

Unique identifier of the user associated with the recipient.

type
integer

Recipient type.
0 – To.
1 – CC.
2 – BCC.

email
string

Email address of the recipient.

isDistributionList
boolean

Indicates if the recipient is a distribution list rather than an individual user.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

revoked
boolean

Indicates whether the recipient's tracking access has been revoked.

policyDirective
integer

Indicates the restriction type applied to the email

isRead
boolean

Indicates if the email has been read.

bucket
string

The bucket where the email is stored. (e.g. inbox, sent, trash)

body
string

The body of the email.

id
string

Unique identifier of the email package.

selfCopy
boolean

Indicates whether the package includes a copy for the sender.

includeFingerprint
boolean

Indicates whether a fingerprint (hash) of the package should be included for verification.

expire
integer

Expiration time of the package in seconds from creation.

fileCount
any

Count of the files attached to the package.

deleted
boolean

Indicates whether the package has been marked as deleted.

acl
string

Access control list (ACL) associated with the package, specifying who can access it.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

name
string

Name of the DRM-protected file.

size
integer

Size of the DRM-protected file in bytes.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

downloadLink
string

Link for accessing the email.

rawBody
string

Raw email body content without HTML markup.

headline
string

Headline or main title of the email.

notice
string

Notice part of the email.

fullHtmlBody
string

Full HTML body of the email.

emailFrom
string

The email address from which the email was sent.

templateBody
string

Body content generated from the email template.

webFormId
string

Unique identifier of the web form associated with the email.

webFormFields
any

Fields included in the associated web form with the mail.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

sharedMailboxId
string

Unique identifier of the shared mailbox, if applicable.

htmlBody
string

HTML version of the email body.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

darkModeStyle
string

CSS styles applied for dark mode.

exists
boolean

Indicates whether the email already exists in the system.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_EMAIL_NOT_DRAFT, ERR_ENTITY_IS_DELETED_ATTACHMENT, ERR_ENTITY_IS_SECURE_FOLDER, ERR_INPUT_EMAIL_WITH_NO_RECIPIENTS_NOT_ALLOWED, ERR_INPUT_SECURE_BODY_WITH_NO_AUTH_NOT_ALLOWED, ERR_PROFILE_INCLUDE_FINGERPRINT_DISABLED, ERR_PROFILE_INCLUDE_FINGERPRINT_ENABLED, ERR_PROFILE_RETURN_RECEIPT_DISABLED, ERR_PROFILE_RETURN_RECEIPT_ENABLED, ERR_PROFILE_SECURE_EMAIL_DISABLED, ERR_PROFILE_SELF_COPY_DISABLED, ERR_PROFILE_SELF_COPY_ENABLED, ERR_PROFILE_SEND_FILE_EXTERNAL_DISABLED, ERR_USER_HAS_NO_USER_TYPE, ERR_USER_TYPE_NO_ACCESS

code
string

Error code

message
string

Error message

Unprocessable Content

Possible error codes: ERR_INPUT_EXCEEDS_MAX_VALUE, ERR_INPUT_HYPERLINK, ERR_INPUT_INVALID_DATE, ERR_INPUT_PAST_DATE, ERR_INVALID_PARAMETER, ERR_HEP_VALIDATION_BLOCK (raw validation service response when HEP policy blocks send)

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PUT \
  "https://{instance}.kiteworks.com/rest/mail/:id/actions/sendFile" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
         "to": [
         "string"
       ],
         "cc": [
         "string"
       ],
         "bcc": [
         "string"
       ],
         "files": [
         "string"
       ],
         "acl": "verify_recipient",
         "expire": "2024-01-15"
       }'
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/actions/sendFile"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
  "to": [
  "string"
],
  "cc": [
  "string"
],
  "bcc": [
  "string"
],
  "files": [
  "string"
],
  "acl": "verify_recipient",
  "expire": "2024-01-15"
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())
Responses
{ "id": "string", "senderId": "string", "templateId": 1, "status": "string", "type": "string", "date": "2024-01-15" }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_NOT_DRAFT", "message": "The specified email can no longer be updated." } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_DELETED_ATTACHMENT", "message": "Requested Attachment(s) is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_SECURE_FOLDER", "message": "Operation not permitted on restricted Folder." } ] }
{ "errors": [ { "code": "ERR_INPUT_EMAIL_WITH_NO_RECIPIENTS_NOT_ALLOWED", "message": "The mail cannot be sent without any recipients" } ] }
{ "errors": [ { "code": "ERR_INPUT_SECURE_BODY_WITH_NO_AUTH_NOT_ALLOWED", "message": "Email message body cannot be secured if email does not require authentication" } ] }
{ "errors": [ { "code": "ERR_PROFILE_INCLUDE_FINGERPRINT_DISABLED", "message": "This profile is not allowed to include fingerprint with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_INCLUDE_FINGERPRINT_ENABLED", "message": "This profile cannot disable including fingerprint with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_RETURN_RECEIPT_DISABLED", "message": "This profile is not allowed to set receipt notification with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_RETURN_RECEIPT_ENABLED", "message": "This profile cannot disable return receipt notification with sent files" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SECURE_EMAIL_DISABLED", "message": "This profile is not allowed to send secure emails" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SELF_COPY_DISABLED", "message": "This profile is not allowed to send copy to self" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SELF_COPY_ENABLED", "message": "Cannot disable self copy for this profile" } ] }
{ "errors": [ { "code": "ERR_PROFILE_SEND_FILE_EXTERNAL_DISABLED", "message": "This profile is not allowed to send files to external users" } ] }
{ "errors": [ { "code": "ERR_USER_HAS_NO_USER_TYPE", "message": "User has no profile" } ] }
{ "errors": [ { "code": "ERR_USER_TYPE_NO_ACCESS", "message": "Permission denied" } ] }
{ "errors": [ { "code": "ERR_INPUT_EXCEEDS_MAX_VALUE", "message": "Field value exceeds maximum allowed value" } ] }
{ "errors": [ { "code": "ERR_INPUT_HYPERLINK", "message": "Not allowed hyperlink domain. Hyperlink domain should not different from anchored text domain." } ] }
{ "errors": [ { "code": "ERR_INPUT_INVALID_DATE", "message": "The input is not a valid date." } ] }
{ "errors": [ { "code": "ERR_INPUT_PAST_DATE", "message": "Field value should be future date" } ] }
{ "errors": [ { "code": "ERR_INVALID_PARAMETER", "message": "Invalid Parameter Exception" } ] }
// Error - No Body
GET/rest/mail/{id}/attachments

Get attachments for an email message

Description:

Using an email ID, returns a paginated list of attachments for the specified message, including file metadata for each attachment.

Preconditions:

Must be the sender or a recipient of the message.

Response:

Returns the list of email attachments with metadata, including total count for pagination.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
limit
Optional
integer

Maximum number of attachments to return.

offset
Optional
integer

Number of attachments to skip before returning results, for pagination.

ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).


Responses

Email attachments returned successfully.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

name
string

Name of the DRM-protected file.

size
integer

Size of the DRM-protected file in bytes.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

total
integer

Total number of items available.

limit
integer

Maximum number of items returned per page.

offset
integer

Number of items skipped before the current page.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id/attachments" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/attachments"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "data": [ { "emailPackageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "attachmentId": "string", "withdrawn": true, "drmFile": {}, "accessType": 1, "tags": [ "..." ] } ], "metadata": {} }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
// Error - No Body
GET/rest/mail/{id}/attachments/{attachment_id}

Get an email attachment by attachment ID

Description:

Using a file attachment ID, returns the name and metadata for the specified attachment on a given message.

Preconditions:

Must be the sender or a recipient of the message.

Response:

Returns the attachment filename and associated metadata.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

attachment_id
Required
string

The unique identifier (UUID) of the attachment.

Query Parameters
ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).


Responses

Email attachment returned successfully.

emailPackageId
string

Unique identifier for the email package containing the attachment.

attachmentId
string

Unique identifier for the attachment.

withdrawn
boolean

Indicates whether the attachment has been withdrawn.

name
string

Name of the DRM-protected file.

size
integer

Size of the DRM-protected file in bytes.

accessType
integer

Access type for the attachment (e.g., read-only, editable).

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

objectId
string

Unique identifier for the file associated with the attachment.

name
string

Name of the attachment file.

size
integer

Size of the attachment file in bytes.

mime
string

The MIME type of the attachment file.

created
string

Date when the attachment file was created.

deleted
boolean

Indicates if the attachment has been deleted.

fingerprint
string

A unique hash identifying the file version.

fingerprintAlgo
string

The algorithm used for generating the file version fingerprint. (e.g., sha3-256, md5).

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

adminQuarantineStatus
string

Status of the attachment in the admin quarantine system.

avStatus
string

Antivirus (AV) scan status of the attachment.

dlpStatus
string

Data Loss Prevention (DLP) status of the attachment.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id/attachments/:attachment_id" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.
attachment_id = "VALUE"  # The unique identifier (UUID) of the attachment.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/attachments/{attachment_id}"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "emailPackageId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "attachmentId": "string", "withdrawn": true, "drmFile": {}, "accessType": 1, "tags": [ { "guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "string", "type": "string" } ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
// Error - No Body
GET/rest/mail/{id}/packages

Get the package associated with an email

Description:

Returns the package associated with the specified email message.

Preconditions:

Must have access to the specified email message.

Response:

Returns the email package details.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).


Responses

Email package returned successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id/packages" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/packages"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
// Error - No Body
GET/rest/mail/{id}/recipients

Get email recipients

Description:

Gets a paginated list of recipient email addresses for the specified message.

Preconditions:

Must be the sender or a recipient of the message.

Response:

Returns the recipient email addresses and pagination metadata.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.

ref
Optional
string

The reference ID of the email (Mandatory if the email can be accessed without authentication).

orderBy
Optional
string

Sort order for the recipient list. Default is type:asc.
Allowed values: id:asc, id:desc, type:asc, type:desc.

type
Optional
integer[]

Filter recipients by type. Accepts a comma-separated list of integer values.
0 – To.
1 – CC.
2 – BCC.

limit
Optional
integer

Range limit.

offset
Optional
integer

Range offset.


Responses

Email recipients returned successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id/recipients" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/recipients"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
// Error - No Body
POST/rest/mail/{id}/actions/withdrawFiles

Withdraw files from a sent message

Description:

Using an email ID, withdraws the specified file attachments from a sent message.

Notes:

  • The message itself is not withdrawn. Only the links to its file attachments are deactivated, making the files inaccessible to the original recipients. The files remain in the system until they expire.
  • If a recipient forwarded the message before it was withdrawn, attachment links remain active for those recipients until the files expire.

Preconditions:

Must be the sender of the message.

Response:

Deactivates download links for the specified email attachments.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
id:in
Required
string[]

A comma-separated list of attachment IDs to be withdrawn.

sharedMailboxId
Optional
string

The unique identifier of the Shared Mailbox. If provided, the operation will be performed within the specified Shared Mailbox context.


Responses

Attachments withdrawn successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_IS_DELETED_ATTACHMENT

code
string

Error code

message
string

Error message

Unprocessable Content

Possible error codes: ERR_INVALID_PARAMETER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X POST \
  "https://{instance}.kiteworks.com/rest/mail/:id/actions/withdrawFiles?id:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/actions/withdrawFiles"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "id:in": "VALUE",
}
response = requests.post(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_DELETED_ATTACHMENT", "message": "Requested Attachment(s) is deleted" } ] }
{ "errors": [ { "code": "ERR_INVALID_PARAMETER", "message": "Invalid Parameter Exception" } ] }
// Error - No Body
POST/rest/mail/{id}/actions/copy

Save email attachments to a Kiteworks folder

Description:

Saves one or more email attachments to a specified Kiteworks folder.

Preconditions:

Must have the `file_copy` permission for the files being copied and `file_add` permission for the destination folder.

Response:

Returns the saved files in the destination folder. If duplicate filenames exist, a number is appended to the saved file names to avoid conflicts.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
id:in
Required
string[]
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.


Request Body
destinationFolderId
Required
string

The ID of the destination folder where the item will be copied/moved.

addVersion
boolean

If a file with the same name exists, create a new version instead of overwriting it. Default is True.


Responses

Attachment files copied successfully.

id
string

Unique identifier (UUID) of the file.

parentId
string

Unique identifier (UUID) of the parent folder.

name
string

Name of the object.

type
string

Type of the object.
f – File.
d – Folder.

userId
string

Unique identifier (UUID) who created the file.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

created
string

The date and time when the object was created.

modified
string

The date and time when the object was last modified.

expire
string

Expiration timestamp of the object, if applicable.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

deleted
boolean

Indicates whether the object has been deleted.

permDeleted
boolean

Indicates whether the object has been permanently deleted.

permalink
string

Permanent URL link to access the file.

path
string

Path to the object in the hierarchy.

objectId
string

Unique identifier (UUID) of the associated object (file or folder).

roleId
integer

Role assigned to the member.

userId
string

Unique identifier (UUID) of the user.

groupId
integer

Unique identifier of the LDAP group.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

id
integer

Role ID

name
string

Role name

rank
integer

Role rank

type
string

Role type

id
integer

LDAP Group ID

name
string

LDAP Group name

dn
string

LDAP Group domain name

email
string

LDAP Group email

description
string

LDAP Group description

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

created
string

Date when the file or folder was shared.

inheritRoleId
integer

Inherited role ID from the parent folder, if applicable.

allowedFolderRoleId
integer[]

List of allowed folder role IDs.

email
string

Email associated with the member.

rank
integer

Rank of the member role.

originFolder
any
vendorDocId
string

Vendor document ID associated with the object.

vendorDocName
string

Name of the vendor document associated with the object.

secure
boolean

Indicates whether the folder or the parent folder containing the file is marked as secure.

source
integer

ID representing the source of the object (1 - Salesforce, 2 - Teams).

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

size
integer

The size of the file in bytes.

mime
string

The MIME type of the file.

fingerprint
string

A unique hash identifying the file.

algo
string

The algorithm used to generate the fingerprint (e.g., sha3-256, md5).

hash
string

The resulting hash value representing the fingerprint of the file or object.

clientCreated
string

The date and time when the file was created on the client side.

clientModified
string

The date and time when the file was last modified on the client side.

overriddenExpire
boolean

Indicates whether the expiration date for the file has been overridden.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

sharedTime
string

The date and time when the file was shared.

id
string

Unique identifier (UUID) of the folder.

parentId
string

Unique identifier (UUID) of the parent object.

name
string

Name of the object.

type
string

Type of the object.
f – File.
d – Folder.

userId
string

Unique identifier (UUID) who created the folder.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

created
string

The date and time when the object was created.

modified
string

The date and time when the object was last modified.

expire
string

Expiration timestamp of the object, if applicable.

id
integer

Unique identifier for the permission.

name
string

Name of the permission.

allowed
boolean

Indicates whether the permission is granted (True) or denied (False).

deleted
boolean

Indicates whether the object has been deleted.

permDeleted
boolean

Indicates whether the object has been permanently deleted.

permalink
string

Permanent URL link to access the object.

path
string

Path to the folder in the hierarchy.

objectId
string

Unique identifier (UUID) of the associated object (file or folder).

roleId
integer

Role assigned to the member.

userId
string

Unique identifier (UUID) of the user.

groupId
integer

Unique identifier of the LDAP group.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

id
integer

Role ID

name
string

Role name

rank
integer

Role rank

type
string

Role type

id
integer

LDAP Group ID

name
string

LDAP Group name

dn
string

LDAP Group domain name

email
string

LDAP Group email

description
string

LDAP Group description

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

created
string

Date when the file or folder was shared.

inheritRoleId
integer

Inherited role ID from the parent folder, if applicable.

allowedFolderRoleId
integer[]

List of allowed folder role IDs.

email
string

Email associated with the member.

rank
integer

Rank of the member role.

originFolder
any
vendorDocId
string

Vendor document ID associated with the object.

vendorDocName
string

Name of the vendor document associated with the object.

secure
boolean

Indicates whether the folder or the parent folder containing the file is marked as secure.

source
integer

ID representing the source of the object (1 - Salesforce, 2 - Teams).

isShared
boolean

Indicates if the folder is shared with other users.

syncable
boolean

Indicates if the folder can be synced by Desktop Sync Client.

fileLifetime
integer

Time duration (in days) for which the files in this folder are kept after being added to the folder.

description
string

The description of the folder.

isFavorite
boolean

Indicates if the folder is marked as a favorite by the user.

pushedFilesCount
integer

The number of files that have been pushed to mobile apps in this folder.

id
integer

Role ID

name
string

Role name

rank
integer

Role rank

type
string

Role type

avStatus
string

The Antivirus (AV) status of the folder.

dlpStatus
string

The Data Loss Prevention (DLP) status of the folder.

totalMembersCount
integer

Total number of members who have access to this folder.

totalFoldersCount
integer

Total number of subfolders within this folder.

totalFilesCount
integer

Total number of files within this folder.

maxFolderExpiration
string

The maximum expiration date allowed for files in this folder.

maxFileLifetime
integer

The maximum duration (in days) that files in this folder can be kept after being added to the folder.

isLdapGroupMember
boolean

Indicates if the folder is part of an LDAP group.

isUnderMyFolder
boolean

Indicates if this folder is a subfolder of the user's "My Folder".

pathIds
string

A list of IDs representing the path of the folder within the folder hierarchy.

isRoot
boolean

Indicates if this folder is a root folder.

rootId
string

The ID of the root folder if this is a subfolder.

useFolderQuota
boolean

Indicates if a folder quota is applied to this folder.

quota
integer

The storage quota for the folder (in bytes).

size
integer

The total storage size used by the folder (in bytes).

freeSpace
integer

The amount of free space available in the folder (in bytes).

inheritanceEnabled
boolean

Indicates if a folder inherits permissions from the parent folder

originalFileId
string

The ID of the original file if this one is a copy.

avStatus
string

Indicates the file version's availability status based on Antivirus (AV) settings and whether it has been scanned or detected as infected.

dlpStatus
string

Indicates the file version's availability status based on Data Loss Prevention (DLP) settings and whether it has been scanned or detected as infected.

adminQuarantineStatus
string

Indicates the file version's availability status based on the administrator's quarantine status.

locked
boolean

Indicates if the file is locked.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

isShared
boolean

Indicates if the file is shared with other users.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

objectId
string

Unique identifier (UUID) for the pushed object.

userId
string

Unique identifier (UUID) for the user who pushed the object.

created
string

The date and time when the object was pushed.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

pathIds
string

A list of IDs representing the path of the file within the folder hierarchy.

wopiSrc
string

The WOPI (Web Application Open Platform Interface) source URL for the mobile application.

userId
string

Unique identifier of the user.

service
string

The WOPI service ID.

scheme
string

URI scheme used by the mobile application to handle the file.

schemeSupport
string

Indicates the level of support the mobile app has for the URI scheme.

pushed
boolean

Indicates if the file has been pushed to a mobile app.

guid
string

Unique identifier (UUID) for the tag.

name
string

Display name of the tag.

type
string

Type category of the tag.

safeEditLocked
boolean

Indicates if the file is locked through a SafeEdit session.

id
string

Unique identifier (UUID) for the user.

email
string

Email address associated with the user.

name
string

Full name of the user.

profileIcon
string

URL or identifier for the user's profile icon.

versionsCount
integer

The total number of versions for the file.

tracking_id
string

Tracking identifier associated with the file upload.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_IS_BASE_DIR, ERR_ENTITY_IS_DELETED_ATTACHMENT, ERR_ENTITY_IS_MY_DIR, ERR_ENTITY_IS_SECURE_FOLDER, ERR_ENTITY_RESTRICTED_EXTENSION, ERR_ENTITY_RESTRICTED_TYPE

code
string

Error code

message
string

Error message

Unprocessable Content

Possible error codes: ERR_INVALID_PARAMETER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X POST \
  "https://{instance}.kiteworks.com/rest/mail/:id/actions/copy?id:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
         "destinationFolderId": "string",
         "addVersion": true
       }'
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/actions/copy"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
params = {
    "id:in": "VALUE",
}
payload = {
  "destinationFolderId": "string",
  "addVersion": true
}
response = requests.post(url, params=params, headers=headers, json=payload)
print(response.json())
Responses
{ "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "parentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "string", "type": "string", "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "creator": {} }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_BASE_DIR", "message": "Operation not permitted on Base Folder" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_DELETED_ATTACHMENT", "message": "Requested Attachment(s) is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_MY_DIR", "message": "Operation not permitted on Tray Folder" } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_SECURE_FOLDER", "message": "Operation not permitted on restricted Folder." } ] }
{ "errors": [ { "code": "ERR_ENTITY_RESTRICTED_EXTENSION", "message": "File extension is in exclusion extensions list" } ] }
{ "errors": [ { "code": "ERR_ENTITY_RESTRICTED_TYPE", "message": "The specified entity mime type is not allowed." } ] }
{ "errors": [ { "code": "ERR_INVALID_PARAMETER", "message": "Invalid Parameter Exception" } ] }
// Error - No Body
POST/rest/mail/{id}/actions/sendTrackingReport

Send tracked activity report for a sent message

Description:

Generates and emails a tracked activity report for a sent message to the current user's Inbox.

Preconditions:

Must be the sender of the message and have tracking access enabled.

Response:

Sends the tracking report to the current user's Inbox.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.

Query Parameters
returnEntity
Optional
boolean

If true, includes the entity in the response body.

with
Optional
string

Specifies additional fields to include in the response.

mode
Optional
string

Determines the detail level of the response body.


Responses

Tracking report sent successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_NOT_SENDER, ERR_ACCESS_USER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X POST \
  "https://{instance}.kiteworks.com/rest/mail/:id/actions/sendTrackingReport" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/actions/sendTrackingReport"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.post(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
// Error - No Body
GET/rest/mail/attachments

Get email attachments sent by the current user

Description:

Using an email ID, gets a list of files attached to messages in the current user's Inbox or Drafts folder, including file metadata.

Preconditions:

Messages must belong to the current user.

Response:

Returns the list of email attachments with associated metadata.

Sorting:

Sort string syntax `FIELD_NAME:ORDER`.

ORDER can be asc or desc.

Sorting options:


FIELD_NAMEDescription
idThe mail ID
subjectThe mail subject
sent_dateThe date the mail was sent
modified_dateThe date the mail was last modified
typeThe mail type: sent, draft, or request
sizeThe file size

Parameters
Query Parameters
limit
Optional
integer

Range limit.

offset
Optional
integer

Range offset.

bucket
Optional
string

Filters attachments to those belonging to emails in the specified bucket.
inbox – Received emails.
draft – Unsent draft emails.
outgoing – Emails queued or in progress.
sent – Successfully sent emails.
trash – Deleted emails.

orderBy
Optional
string

Sort order for the results. Default is id:desc.
Allowed values: id:asc, id:desc, subject:asc, subject:desc, sent_date:asc, sent_date:desc, modified_date:asc, modified_date:desc, type:asc, type:desc, size:asc, size:desc.


Responses

Email attachments returned successfully.

emailId
string
subject
string

Subject line of the email containing this attachment.

size
string

Size of the attachment in bytes.

name
string

File name of the attachment.

sentDate
string

Date and time when the email was sent.

modifiedDate
string

Date and time when the attachment was last modified.

attachmentId
string

Unique identifier (UUID) of the attachment.

mime
string

MIME type of the attachment.

webFormId
string

Identifier of the web form associated with the attachment, if any.

type
string

Type of the attachment.

total
integer

Total number of items available.

limit
integer

Maximum number of items returned per page.

offset
integer

Number of items skipped before the current page.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/attachments" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/attachments"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
{ "data": [ { "emailId": "string", "subject": "string", "size": "string", "name": "string", "sentDate": "2024-01-15", "modifiedDate": "2024-01-15" } ], "metadata": {} }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
// Error - No Body
DELETE/rest/mail/attachments

Withdraw multiple files from messages in Sent and Drafts folders

Description:

Using attachment IDs, withdraws the specified attachments from messages in the current user's Sent and Drafts folders.

Notes:

  • The message itself is not withdrawn. Only the links to its file attachments are deactivated, making the files inaccessible to the original recipients. The files remain in the system until they expire.
  • If a recipient forwarded the message before it was withdrawn, attachment links remain active for those recipients until the files expire.

Preconditions:

Must be the sender of the messages.

Response:

Deactivates download links for the specified attachments across all matching Sent and Draft messages.
Parameters
Query Parameters
id:in
Required
string[]

Responses

Specified attachments withdrawn successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Unprocessable Content

Possible error codes: ERR_INVALID_PARAMETER

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X DELETE \
  "https://{instance}.kiteworks.com/rest/mail/attachments?id:in=VALUE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/attachments"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
params = {
    "id:in": "VALUE",
}
response = requests.delete(url, params=params, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_INVALID_PARAMETER", "message": "Invalid Parameter Exception" } ] }
// Error - No Body
POST/rest/mail/actions/withdraw

Withdraw messages from Sent and Drafts folders

Description:

Using email IDs, withdraws messages from the current user's Sent and Drafts folders.

Notes:

  • The messages themselves are not withdrawn. Only the links to their file attachments are deactivated, making the files inaccessible to the original recipients. The files remain in the system until they expire.
  • If a recipient forwarded a message before it was withdrawn, attachment links remain active for those recipients until the files expire.

Preconditions:

Must be the sender of the messages.

Response:

Deactivates download links for attachments in the specified messages.
Request Body
ids
Required
string[]

List of email UUIDs to withdraw. Withdrawing an email revokes recipient access to its attachments.


Responses

Email messages withdrawn successfully.

Empty response body.

Partially successful — some messages could not be withdrawn.

code
string

Error code

message
string

Error message

field
string

Associated field, if applicable.

failedIds
integer[]

List of failed IDs.

successIds
integer[]

List of succeeded IDs.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED, ERR_ENTITY_EMAIL_IS_NOT_COMPLETED, ERR_ACCESS_NOT_SENDER, ERR_MAIL_BODY_UNSECURED, ERR_ENTITY_IS_EMAIL_CONTENT

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X POST \
  "https://{instance}.kiteworks.com/rest/mail/actions/withdraw" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
         "ids": [
         "string"
       ]
       }'
Python
import requests

url = "https://{instance}.kiteworks.com/rest/mail/actions/withdraw"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
  "ids": [
  "string"
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "string", "message": "string", "field": "string", "failedIds": [ "..." ] } ], "successIds": [ 1 ] }
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_NOT_COMPLETED", "message": "Email is not completed" } ] }
{ "errors": [ { "code": "ERR_ACCESS_NOT_SENDER", "message": "Authenticated user is not the sender of the specified email" } ] }
{ "errors": [ { "code": "ERR_MAIL_BODY_UNSECURED", "message": "Mail body is unsecured." } ] }
{ "errors": [ { "code": "ERR_ENTITY_IS_EMAIL_CONTENT", "message": "Operation not permitted on email content" } ] }
// Error - No Body
GET/rest/mail/{id}/scanStatus

Get email message security scan status

Description:

Gets the security scan results for a mail message. Depending on system scan policies, message content and attachments may be scanned for antivirus threats, data loss prevention (DLP) violations, and advanced threat protection (ATP).

Preconditions:

Must be the sender or a recipient of the message.

Response:

Returns the security scan status for the message and its attachments.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.


Responses

Message and attachments (if any) have passed all security scans successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_EMAIL_IS_DRAFT, ERR_ENTITY_EMAIL_SCANNING, ERR_ENTITY_EMAIL_SCANNING_DISALLOWED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X GET \
  "https://{instance}.kiteworks.com/rest/mail/:id/scanStatus" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/scanStatus"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.get(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_IS_DRAFT", "message": "The action cannot be performed on draft." } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_SCANNING", "message": "One or more files, or the email, are undergoing security and privacy scans. Please try again later." } ] }
{ "errors": [ { "code": "ERR_ENTITY_EMAIL_SCANNING_DISALLOWED", "message": "One or more files, or the email, are blocked by system policy." } ] }
// Error - No Body
DELETE/rest/mail/{id}/trackings/me

Remove message tracking access

Description:

Removes the current user's access to tracking activity on a specified message.

Preconditions:

Must be a recipient of the email and have tracking access.

Response:

Revokes the current user's tracking access for the specified message.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.


Responses

Email tracking access removed successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_INVALID_CSRF, ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_ENTITY_DELETED

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X DELETE \
  "https://{instance}.kiteworks.com/rest/mail/:id/trackings/me" \
  -H "Authorization: Bearer YOUR_TOKEN"
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/trackings/me"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
}
response = requests.delete(url, headers=headers)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_INVALID_CSRF", "message": "Invalid CSRF Authentication" } ] }
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_ENTITY_DELETED", "message": "Entity is deleted" } ] }
// Error - No Body
PUT/rest/mail/{id}/settings

Update message tracking access

Description:

Updates the tracking access settings for a sent message, adding or removing tracking permissions for specified users.

Preconditions:

Must be the sender of the message and have tracking access enabled.

Response:

Returns a confirmation that tracking access has been updated for the specified users.
Parameters
Path Parameters
id
Required
string

The unique identifier (UUID) of the email.


Request Body
trackingAccess
string[]

List of email addresses to grant access to the email's download tracking dashboard.


Responses

Mail tracking settings updated successfully.

Empty response body.

Unauthorized

Possible error codes: ERR_AUTH_UNAUTHORIZED

code
string

Error code

message
string

Error message

Forbidden

Possible error codes: ERR_ACCESS_USER, ERR_NOT_INTERNAL_DOMAIN, ERR_INSUFFICIENT_TRACKING_PERMISSIONS

code
string

Error code

message
string

Error message

Request blocked by WAF

Empty response body.
Shell
curl -X PUT \
  "https://{instance}.kiteworks.com/rest/mail/:id/settings" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
         "trackingAccess": [
         "string"
       ]
       }'
Python
import requests

id = "VALUE"  # The unique identifier (UUID) of the email.

url = f"https://{{instance}}.kiteworks.com/rest/mail/{id}/settings"
headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
}
payload = {
  "trackingAccess": [
  "string"
]
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())
Responses
// Request successful - No Body
{ "errors": [ { "code": "ERR_AUTH_UNAUTHORIZED", "message": "Unauthorized" } ] }
{ "errors": [ { "code": "ERR_ACCESS_USER", "message": "Insufficient access permissions" } ] }
{ "errors": [ { "code": "ERR_NOT_INTERNAL_DOMAIN", "message": "The email is not internal domain" } ] }
{ "errors": [ { "code": "ERR_INSUFFICIENT_TRACKING_PERMISSIONS", "message": "This profile is not allowed to give tracking access due to insufficient permissions" } ] }
// Error - No Body