---
title: "init(contentType:content:metadata:)"
framework: Foundation Models
role: symbol
role_heading: Initializer
platforms: [iOS 27.2+, iPadOS 27.2+, Mac Catalyst 27.2+, macOS 27.2+, visionOS 27.2+, watchOS 27.2+]
path: "foundationmodels/transcript/dataattachment/init(contenttype:content:metadata:)"
---

# init(contentType:content:metadata:)

Creates a data attachment with the content type, content, and metadata you provide.

## Declaration

```swift
init(contentType: UTType, content: Data, metadata: GeneratedContent = GeneratedContent(properties: [:]))
```

## Parameters

- `contentType`: A UTType identifying how to interpret content.
- `content`: A raw binary representation of the attachment.
- `metadata`: Metadata pertinent to this attachment.
