attachment_too_large
A file is over the 10 MB per-file limit. Nothing was sent; compress or resize it.
HTTP 422The request was understood but refused as sent. Change it before retrying.
When it fires
One of the files is larger than 10 MB, the per-file limit on every channel that takes attachments. index and field name the file. The size is measured on the download itself, so a server that under-reports the size is still caught. Nothing was sent.
Response shape
Every Repull error follows the same envelope. The code is stable and safe to switch on.
{
"error": {
"code": "attachment_too_large",
"message": "Attachment 0 is larger than the 10 MB limit. Nothing was sent.",
"fix": "Compress or resize the file to under 10 MB and send again.",
"docs_url": "https://repull.dev/docs/errors/attachment_too_large",
"request_id": "req_01J5X7Y8Z9ABCDEF12345678",
"field": "attachments[0]",
"channel": "airbnb",
"index": 0
}
}How to fix
- Resize or re-compress the file named by `index` to under 10 MB. For photos, a long edge of about 2000 px at JPEG quality 80 is usually well under 1 MB.
- For video on Airbnb, shorten or re-encode the clip; for anything larger, send a link to it in `message` instead.
- Send the request again with the smaller file.
Examples
curl
# Shrink a photo before sending (ImageMagick)
magick parking-map.png -resize 2000x2000\> -quality 80 parking-map.jpg
curl -X POST https://api.repull.dev/v1/conversations/164743/messages \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "Here is the parking map.", "attachments": [{"url": "https://cdn.example.com/parking-map.jpg"}]}'TypeScript
import sharp from 'sharp'
// Keep photos comfortably under the 10 MB per-file limit before uploading them
const jpeg = await sharp(original).resize(2000, 2000, { fit: 'inside' }).jpeg({ quality: 80 }).toBuffer()
const url = await uploadToYourStorage(jpeg) // returns a public or signed https URL
await fetch('https://api.repull.dev/v1/conversations/164743/messages', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.REPULL_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: 'Here is the parking map.', attachments: [{ url }] }),
})If you're an AI agent
A file is over the 10 MB per-file limit. Nothing was sent. Compress or resize the file named by `index` (or send a link to it in the text) and send again.
Related
- Error reference — the full table of error codes
- Using Repull from AI agents — patterns for handling errors in agent loops
- Sending attachments
Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.
AI