Mails

Resource Fields

Name Type Read-only Description
from string
to string
sender User
subject string
source string
text string
html string
status string RECEIVED, PROCESSING, SUCCESS , FAILED, REJECTED, SUSPENDED
suspension_code string INVALID_CASE_TOKEN, UNREGISTERED_USER, UNVERIFIED_EMAIL , NOT_PARTICIPANT, NO_FROM_ADDRESS, AUTOMATED_EMAIL, BLOCKLISTED_EMAIL, DELIVERY_FAILED, LOOP_DETECTED, SOURCE_IS_MAILBOX, MAILER_DAEMON, SOURCE_IS_NOREPLY, OUT_OF_OFFICE_EMAIL, SPAM, INVALID_EMAIL_HEADERS, INVALID_FROM_ADDRESS
reason string
message_id string Message ID of email
size string
mailbox Mailbox
case Case
case_post Message
time_taken integer
is_suspended boolean
created_at timestamp ISO-8601 Format
completed_at timestamp ISO-8601 Format

Metadata




 
 




Actions

Retrieve all mails

GET /api/v1/mails.json

Information

Allowed for Collaborators, Agents & Admins

Only suspended mails are allowed to agents and collaborators.

Arguments

Name Type Mandatory Description
is_suspended boolean Whether to return mails that are suspended. Allowed values: true, false

Response

    {
        "status": 200,
        "data": [
            {
    "id": 1,
    "from": "caryn.pryor@atmospherecoffeeinc.com",
    "to": "support@brewfictus.kayako.com",
    "sender": 




{
    "id": 2,

    "resource_type": "user"

}
,
    "subject": "Can I change the delivery address of my order?",
    "source": "\nMIME-Version: 1.0\nReceived: by 10.27.132.196 with HTTP; Thu, 2 Jul 2015 09:37:20 -0700 (PDT)\nDate: Thu, 2 Jul 2015 22:07:20 +0530\nDelivered-To: caryn.pryor@atmospherecoffeeinc.com\nMessage-ID: <CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com>\nSubject: Can I change the delivery address of my order?\nFrom: Caryn Pryor <caryn.pryor@atmospherecoffeeinc.com>\nTo: support@brewfictus.kayako.com\nContent-Type: text/plain; charset=UTF-8\n\nHi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "text": "Hi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "html": null,
    "status": "SUSPENDED",
    "suspension_code": null,
    "reason": null,
    "message_id": "CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com",
    "size": 569,
    "mailbox": {
    "id": 1,

    "resource_type": "mailbox"

}
,
    "case": {
    "id": 1,

    "resource_type": "case"

}
,
    "case_message": {
    "id": 1,

    "resource_type": "case_message"

}
,
    "time_taken": 0,
    "is_suspended": true,
    "created_at": "2015-07-02T16:38:11+05:00",
    "completed_at": "2015-07-02T16:38:11+05:00",
    "resource_type": "mail",
    "resource_url": "https://brewfictus.kayako.com/api/v1/mails/1"
}

        ],
        "resource": "mail",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a mail

GET /api/v1/mails/:id.json

Information

Allowed for Collaborators, Agents, Admins & Owners

If there is a case linked with the mail, then the permission depends on case accessibility. However, suspended mail is allowed to all.

Response

    {
        "status": 200,
        "data": {
    "id": 1,
    "from": "caryn.pryor@atmospherecoffeeinc.com",
    "to": "support@brewfictus.kayako.com",
    "sender": 




{
    "id": 2,

    "resource_type": "user"

}
,
    "subject": "Can I change the delivery address of my order?",
    "source": "\nMIME-Version: 1.0\nReceived: by 10.27.132.196 with HTTP; Thu, 2 Jul 2015 09:37:20 -0700 (PDT)\nDate: Thu, 2 Jul 2015 22:07:20 +0530\nDelivered-To: caryn.pryor@atmospherecoffeeinc.com\nMessage-ID: <CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com>\nSubject: Can I change the delivery address of my order?\nFrom: Caryn Pryor <caryn.pryor@atmospherecoffeeinc.com>\nTo: support@brewfictus.kayako.com\nContent-Type: text/plain; charset=UTF-8\n\nHi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "text": "Hi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "html": null,
    "status": "SUSPENDED",
    "suspension_code": null,
    "reason": null,
    "message_id": "CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com",
    "size": 569,
    "mailbox": {
    "id": 1,

    "resource_type": "mailbox"

}
,
    "case": {
    "id": 1,

    "resource_type": "case"

}
,
    "case_message": {
    "id": 1,

    "resource_type": "case_message"

}
,
    "time_taken": 0,
    "is_suspended": true,
    "created_at": "2015-07-02T16:38:11+05:00",
    "completed_at": "2015-07-02T16:38:11+05:00",
    "resource_type": "mail",
    "resource_url": "https://brewfictus.kayako.com/api/v1/mails/1"
}
,
        "resource": "mail"
    }

Process a mail

PUT /api/v1/mails/:id.json

Information

Allowed for Agents, Admins & Owners

Only suspended mails are allowed for this action.

Parameters

Name Type Mandatory Description
is_suspended boolean
Allowed value: false

Response

    {
        "status": 200,
        "data": {
    "id": 1,
    "from": "caryn.pryor@atmospherecoffeeinc.com",
    "to": "support@brewfictus.kayako.com",
    "sender": 




{
    "id": 2,

    "resource_type": "user"

}
,
    "subject": "Can I change the delivery address of my order?",
    "source": "\nMIME-Version: 1.0\nReceived: by 10.27.132.196 with HTTP; Thu, 2 Jul 2015 09:37:20 -0700 (PDT)\nDate: Thu, 2 Jul 2015 22:07:20 +0530\nDelivered-To: caryn.pryor@atmospherecoffeeinc.com\nMessage-ID: <CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com>\nSubject: Can I change the delivery address of my order?\nFrom: Caryn Pryor <caryn.pryor@atmospherecoffeeinc.com>\nTo: support@brewfictus.kayako.com\nContent-Type: text/plain; charset=UTF-8\n\nHi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "text": "Hi,\n\nI have just placed an order for two coffees. Can I change the delivery\naddress of my order?\n\n--\nThanks\nCaryn Pryor\n",
    "html": null,
    "status": "SUSPENDED",
    "suspension_code": null,
    "reason": null,
    "message_id": "CAAX98m6PjhWWDTERj36JtpXasmuRB5f0qUaqVr6caR0PZFc4uQ@mail.gmail.com",
    "size": 569,
    "mailbox": {
    "id": 1,

    "resource_type": "mailbox"

}
,
    "case": {
    "id": 1,

    "resource_type": "case"

}
,
    "case_message": {
    "id": 1,

    "resource_type": "case_message"

}
,
    "time_taken": 0,
    "is_suspended": true,
    "created_at": "2015-07-02T16:38:11+05:00",
    "completed_at": "2015-07-02T16:38:11+05:00",
    "resource_type": "mail",
    "resource_url": "https://brewfictus.kayako.com/api/v1/mails/1"
}
,
        "resource": "mail"
    }

Process mails

PUT /api/v1/mails.json

Information

Allowed for Agents, Admins & Owners

Only suspended mails are allowed for this action.

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Parameters

Name Type Mandatory Description
is_suspended boolean
Allowed value: false

Response

{
    "status": 200,
    "total_count": 2
}

Delete a mail

DELETE /api/v1/mails/:id.json

Information

Allowed for Agents & Admins

Only suspended mails are allowed for this action.

Response

{
    "status": 200
}

Delete mails

DELETE /api/v1/mails.json

Information

Allowed for Agents, Admins & Owners

Only suspended mails are allowed for this action.

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

{
    "status": 200,
    "total_count": 2
}