Ana içeriğe geç

Stage media-library files onto a conversation

POST 

/api/conversations/:conversationId/attachments/from-library

Copies one or more MEDIA LIBRARY files into this conversation as PENDING attachments — the same shape uploadAttachment returns, so the returned ids go on to sendMessage as attachment_ids exactly like an upload.

This is how a saved reply's image is sent. A saved reply stores only a REFERENCE to a library file, because library files are served by short-lived signed urls and a stored url would be dead long before an agent used the reply.

Each copy points at the same stored object, so the workspace is not charged twice for one file and tidying the library later cannot blank a message that already went out. A reference whose file has since left the library is skipped rather than failing the call. Files the channel cannot carry are rejected with 422, using the same limits as an upload.

Authorized through the conversation's reply ability.

Request​

Responses​

The staged (pending) attachments.