Legacy Mailbox API 1.0 is deprecated

Legacy Mailbox API 1.0 was deprecated on November 20, 2019. Please use Mailbox API 2.0 going forward. If you have any questions or need help with the new API, please reach out.

Create Attachment

  • REST Method: POST
  • URL: https://api.helpscout.net/v1/attachments.json
  • Content-Type: application/json

An attachment must be sent to the API before it can be used in a thread. Use this method to create the attachment, then use the resulting hash when creating a thread.

Note that we only support attachments of 10MB or lower.

Request

Name Type Required Default Notes
attachment Attachment Y   The body of the request (see example below).
{
    "fileName" : "file.txt",
    "mimeType" : "text/plain",
    "data": "Q1JFQVRFIFRBQkxFIGBoZWxwc2NvdXRfYXR0YWNobWVudHNf..."
}

Accepted Fields

Name Type Required Default Notes
fileName string Y    
mimeType string Y    
data string Y   Base64-encoded stream of data.

Response

Response Name Type Notes
Header Status Integer 201
Body item string The hash of the created attachment. Use this hash when associating the attachment with a new thread.
Status: 201 Created
{
    "item" : {
        "hash" : "4739784d4ee19b445d0ab600f6a99784628c005a"
    }
}