## Upload `client.Assets.Upload(ctx, body) (*AssetUploadResponse, error)` **post** `/v1/assets/upload` Upload a file to a temporary location using multipart/form-data. Returns an uploadID that can be referenced when sending messages with attachments. ### Parameters - `body AssetUploadParams` - `File param.Field[Reader]` The file to upload (max 500 MB). - `FileName param.Field[string]` Original filename. Defaults to the uploaded file name if omitted - `MimeType param.Field[string]` MIME type. Auto-detected from magic bytes if omitted ### Returns - `type AssetUploadResponse struct{…}` - `Duration float64` Duration in seconds (audio/videos) - `Error string` Error message if upload failed - `FileName string` Resolved filename - `FileSize float64` File size in bytes - `Height float64` Height in pixels (images/videos) - `MimeType string` Detected or provided MIME type - `SrcURL string` Local file URL (file://) for the uploaded asset - `UploadID string` Unique upload ID for this asset - `Width float64` Width in pixels (images/videos) ### Example ```go package main import ( "bytes" "context" "fmt" "io" "github.com/beeper/desktop-api-go" ) func main() { client := beeperdesktopapi.NewClient( ) response, err := client.Assets.Upload(context.TODO(), beeperdesktopapi.AssetUploadParams{ File: io.Reader(bytes.NewBuffer([]byte("some file contents"))), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.Width) } ```