Skip to Content

Get an attachment

Returns metadata for a single attachment, including filename, content type, and size.

GET
/v1/attachments/{id}

Returns metadata for a single attachment, including filename, content type, and size.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Response Body

Success

application/json
  1. response
id*AttachmentId
Match^att_[0-9a-hjkmnp-tv-z]{16,24}$
messageId*MessageId
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$
organizationId*OrganizationId
Match^org_[0-9a-hjkmnp-tv-z]{16,24}$
filename*string
contentType*string
size*integer
Range0 <= value <= 9007199254740991
contentId*string|null
isInline*boolean
createdAt*string
Example Request
import { createClient } from "samva";

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

const result = await samva.attachments.getById({
  "id": "example"
});
Example Response
{
  "id": "string",
  "messageId": "string",
  "organizationId": "string",
  "filename": "string",
  "contentType": "string",
  "size": 0,
  "contentId": "string",
  "isInline": true,
  "createdAt": "string"
}

Related documentation