## Upload a file

**post** `/v1/assets/upload`

Upload a file to a temporary location using multipart/form-data. Returns an uploadID that can be referenced when sending a message or creating a draft attachment.

### Returns

- `duration: optional number`

  Duration in seconds (audio/videos)

- `error: optional string`

  Error message if upload failed

- `fileName: optional string`

  Resolved filename

- `fileSize: optional number`

  File size in bytes

- `height: optional number`

  Height in pixels (images/videos)

- `mimeType: optional string`

  Detected or provided MIME type

- `srcURL: optional string`

  Local file URL (file://) for the uploaded file

- `uploadID: optional string`

  Unique upload ID for this temporary file

- `width: optional number`

  Width in pixels (images/videos)

### Example

```http
curl http://localhost:23373/v1/assets/upload \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $BEEPER_ACCESS_TOKEN" \
    -F 'file=@/path/to/file'
```

#### Response

```json
{
  "duration": 0,
  "error": "error",
  "fileName": "fileName",
  "fileSize": 0,
  "height": 0,
  "mimeType": "mimeType",
  "srcURL": "srcURL",
  "uploadID": "uploadID",
  "width": 0
}
```
