Skip to Content

Copy a message attachment

Copies one of a received message's attachments into the organization's media and returns it as a draft attachment (`mediaId`), so a draft can carry it.

POST
/v1/mailboxes/{id}/messages/{messageId}/attachments/{attachmentId}/copy

Copies one of a received message's attachments into the organization's media and returns it as a draft attachment (mediaId), so a draft can carry it. A draft that forwards a message saves each original attachment this way.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$
messageId*string
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$
attachmentId*string
Match^att_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

MailboxCopiedAttachment

application/json
  1. response
filename*string
content?string|null
mediaId?|null
contentType*string
size*integer
Range0 < value <= 26214400
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.mailboxes.copyMessageAttachment({
  "id": "example",
  "messageId": "example",
  "attachmentId": "example"
});
Example Response
{
  "filename": "string",
  "content": "string",
  "mediaId": "string",
  "contentType": "string",
  "size": 1
}

Related documentation