Params

NameTypeRequirenessDefault valueDescription
fileobjectrequirednoneThe image to upload: one JPEG, PNG, GIF or WebP file of at most 10 MB, sent as the multipart form part file.

Description

Uploads one image, sent as a multipart form with the file part file, and returns an attachment ID for the attachments of message-booking-guest together with its expiry.

The image is a JPEG, PNG, GIF or WebP file of at most 10 MB. An attachment ID expires 24 hours after upload. An account can make 100 uploads per 10 minutes and hold 100 uploads not yet sent in a message.

This endpoint requires the following scope: messaging-send-attachments

Request sample

Send the image as a multipart/form-data body with one file part named file. The file name of that part becomes the attachment's file name.

curl -X POST "https://www.igms.com/api/v1/message-attachments?access_token=ACCESS_TOKEN" \
     -F "file=@entrance.jpg;type=image/jpeg"

Response sample

expires_dttm is in UTC. Use attachment_id in the attachments of message-booking-guest until then, in any number of messages.

{
    "data": {
        "attachment_id": "matt_01jabcdefghjkmnpqrstvwxyz0",
        "expires_dttm": "2026-10-14 09:30:00"
    }
}

Limits

  • One JPEG, PNG, GIF or WebP image per call, detected from the file content, of at most 10 MB (10,485,760 bytes). The whole request body may not exceed 11 MB.
  • An attachment ID expires 24 hours after upload, whether or not it was sent. An upload never sent in a message is deleted after it expires.
  • An account can make 100 uploads per 10 minutes and hold 100 uploads not yet sent in a message.
  • The file name keeps no double quotes, backslashes, control or formatting characters, is cut to 200 bytes, and ends with the extension of the detected image type: an image extension of another type is replaced, and the extension is added when the name has no image extension.

Error samples

When the file is not an allowed image, nothing is stored:

{
    "error": {
        "code": 11,
        "message": "The file is not a JPEG, PNG, GIF or WebP image"
    }
}

When the file exceeds 10 MB, nothing is stored:

{
    "error": {
        "code": 11,
        "message": "The image exceeds 10 MB"
    }
}

When the account made 100 uploads in the last 10 minutes:

{
    "error": {
        "code": 16,
        "message": "Too many uploads; try again later"
    }
}

When the account holds 100 uploads not yet sent:

{
    "error": {
        "code": 16,
        "message": "Too many unsent uploads; send them or wait until they expire"
    }
}

When the token lacks the messaging-send-attachments scope:

{
    "error": {
        "code": 14,
        "message": "This API token does not have access to the needed scope which are required to perform this operation"
    }
}

A request body over 11 MB is refused with HTTP status 413 before it reaches the API, with an HTML body instead of this JSON error.