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"
    }
}