attachments_not_supported

The conversation's channel cannot carry files (SMS, email, direct-booking site chat), or the endpoint sends text only. Nothing was sent.

HTTP 422The request was understood but refused as sent. Change it before retrying.

When it fires

A message with attachments was sent somewhere that has no way to deliver a file. Files travel on Airbnb and Booking.com conversations only. It fires in three situations:

  • POST /v1/conversations/{id}/messageson a conversation that runs over SMS, email or your direct-booking site's chat. channel in the error says which.
  • The same endpoint with channel forced to sms, email or website alongside attachments. This is refused before anything else is checked.
  • POST /v1/channels/booking/messaging with attachments, attachment_ids or mediaUrl in the body. That endpoint sends text only, and field names the file field you sent.

Nothing was sent, not even the text. Repull refuses the whole message rather than delivering the text and quietly dropping the file.

Response shape

Every Repull error follows the same envelope. The code is stable and safe to switch on.

{
  "error": {
    "code": "attachments_not_supported",
    "message": "This conversation is on sms, which cannot carry attachments. Nothing was sent.",
    "fix": "Attachments can be sent on Airbnb and Booking.com conversations. On this conversation, send the text on its own, or include a link to the file in `message`.",
    "docs_url": "https://repull.dev/docs/errors/attachments_not_supported",
    "request_id": "req_01J5X7Y8Z9ABCDEF12345678",
    "channel": "sms"
  }
}

How to fix

  1. Check `channel` in the error. On SMS, email or site chat, send the text on its own, or put a link to the file inside `message`.
  2. If you forced `channel`, remove it. The conversation's own channel is the right default.
  3. On Booking.com, send files through `POST /v1/conversations/{id}/messages` with `attachments` (JPEG or PNG, with text) instead of `POST /v1/channels/booking/messaging`. `GET /v1/conversations` gives you the conversation id.

Common gotchas

  • Read the conversation's channel before you attach files, so you never build a request that cannot land.
  • The per-channel rules for types, sizes and text are on Send a Message.

Examples

curl

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"}]}'
# → 422 attachments_not_supported when the conversation is SMS, email or site chat

# Recovery: send the link in the text instead
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: https://cdn.example.com/parking-map.jpg"}'

TypeScript

const url = 'https://api.repull.dev/v1/conversations/164743/messages'
const headers = {
  Authorization: `Bearer ${process.env.REPULL_API_KEY}`,
  'Content-Type': 'application/json',
}
const file = 'https://cdn.example.com/parking-map.jpg'

let res = await fetch(url, {
  method: 'POST',
  headers,
  body: JSON.stringify({ message: 'Here is the parking map.', attachments: [{ url: file }] }),
})

if (res.status === 422) {
  const { error } = await res.json()
  if (error.code === 'attachments_not_supported') {
    // This channel cannot carry files: send the link as text instead
    res = await fetch(url, {
      method: 'POST',
      headers,
      body: JSON.stringify({ message: `Here is the parking map: ${file}` }),
    })
  }
}

If you're an AI agent

The conversation's channel cannot carry files, or the endpoint is text-only. Nothing was sent. Send the text alone or with a link to the file in `message`; on Booking.com, use POST /v1/conversations/{id}/messages with attachments. Do not retry the same body.

Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.

AI