---
title: "Upload media"
method: POST
path: "/media"
tags: ["Media"]
---

# Upload media

`POST /media`

## Request

- Base URL: `https://api.sprucehealth.com/v1`
- URL: `https://api.sprucehealth.com/v1/media`
- Auth: HTTP bearer

This operation uploads media such a images, videos, and files to Spruce for use in messaging. Uploading a file will return a media ID that can be used to reference the file in other operations. Callers of this API should record the resulting media ID for future use. A media ID can be used in the `attachmentID` field of the [conversation message post attachment](/reference/postmessagefromendpoint). Media IDs can be used multiple times.
The `Content-Type` and `Content-Disposition` headers on the multipart `media` field can use used to provide additional metadata about the media. This metadata can impact how the media is displayed and downloaded from the application.

**Example Headers**
* `Content-Disposition: form-data; name="media"; filename="image.png"`
* `Content-Type: image/png`

## Request body `multipart/form-data`

- object
  - `media` string, binary, required

## Response `200`

An array of messages that are scheduled for the organization

- Media
  - `id` string, required: Spruce's media message ID
  - `object` string, required: String representing the object's type

## Other responses

- `400`: bad request
- `500`: unexpected error

---

[API](https://skmtc.dev/sprucehealth/apis/spruce-health-api.md) - [All operations](https://skmtc.dev/sprucehealth/apis/spruce-health-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sprucehealth/apis/spruce-health-api/revisions/06e7a37de1ce?raw)
