Resources
Guides for using iMothership at work
Get started, understand the product, and fix things when they go sideways.
Receive webhook
Understand the message and uploaded files available to later task steps through “Save message as”.
The examples below use webhook as the saved message name. Replace it with the name you choose in your Receive webhook step.
What is available in {{webhook}}?
{{webhook}} is one object containing payload and attachments.
Payload:{{webhook.payload}} contains the incoming message body. JSON keeps its object or array structure, form fields are available by name, and plain text is saved as a string. For a JSON body with an orderId field, use {{webhook.payload.orderId}}. A sender's own attachments field stays inside payload, separate from uploaded files.
Uploaded attachments:{{webhook.attachments}} is the array of uploaded file details inside the same webhook object. The array is empty when no files were uploaded.
| Field | Meaning |
|---|---|
filename | The saved file reference. |
originalName | The sender's filename. |
contentType | The MIME type, such as application/pdf. |
size | The file size in bytes. |
Using a saved file: each attachment's filename is its saved file reference. Use {{webhook.attachments.0.filename}} for the first uploaded file in a tag, or webhook.attachments[i].filename when working with the object in JavaScript. Receive webhook does not create a separate emailAttachments tag.
Example task data
A message with one uploaded PDF produces the following task data, with the payload and files inside one object:
{
"webhook": {
"payload": {
"orderId": "123",
"message": "New order"
},
"attachments": [
{
"filename": "webhook-example-0.pdf",
"originalName": "invoice.pdf",
"contentType": "application/pdf",
"size": 12345
}
]
}
}Choosing a different message name
Changing “Save message as” changes the name of the whole object. For example, saving as incomingOrder provides {{incomingOrder.payload}} and {{incomingOrder.attachments}}.
Updating an existing task? Change payload references such as {{webhook.orderId}} to {{webhook.payload.orderId}}, and {{webhookAttachments}} to {{webhook.attachments}}. Use each attachment's filename instead of the former webhook-generated emailAttachments list. The Send Email option for including email attachments applies to Fetch Email output; it no longer automatically includes webhook uploads.
Uploading files and sending links
Upload files using multipart/form-data, with up to 5 files of 2 MB each. Attachment links sent in the body remain links; download them in a later step with any required credentials. File contents and download URLs are not included in the attachment details.
Request metadata and the HTTP acknowledgement
Request headers, query parameters, receipt time, and internal delivery IDs are not added to these tags. The HTTP acknowledgement returned to the sender contains ok, id, duplicate, and provider. It is separate from the message saved for subsequent steps.