Creates a media attachment to be used with a new status. The full sized media will be processed asynchronously in the background for large uploads.
**Returns:** [MediaAttachment]({{< relref "entities/MediaAttachment" >}}), but without a URL\
**OAuth:** User token + `write:media`\
**Version history:**\
3.1.3 - added\
3.2.0 - add `thumbnail` parameter\
4.0.0 - Smaller media formats (image) will be processed synchronously and return 200 instead of 202. Larger media formats (video, gifv, audio) will continue to be processed asynchronously and return 202.
#### Request
##### Headers
Authorization
: {{<required>}} Provide this header with `Bearer <user token>` to gain authorized access to this API method.
##### Form data parameters
file
: {{<required>}} Object. The file to be attached, encoded using multipart form data. The file must have a MIME type.
thumbnail
: Object. The custom thumbnail of the media to be attached, encoded using multipart form data.
description
: String. A plain-text description of the media, for accessibility purposes.
focus
: String. Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0. See [Focal points for cropping media thumbnails]({{< relref "api/guidelines#focal-points" >}}) for more information.
#### Response
##### 200: OK
MediaAttachment was created successfully, and the full-size file was processed synchronously.
MediaAttachment was created successfully, but the full-size file is still processing. Note that the MediaAttachment's `url` will still be null, as the media is still being processed in the background. However, the `preview_url` should be available. Use [`GET /api/v1/media/:id`](#get) to check the status of the media attachment.
Get a media attachment, before it is attached to a status and posted, but after it is accepted for processing. Use this method to check that the full-sized media has finished processing.
: {{<required>}} String. The ID of the MediaAttachment in the database.
##### Headers
Authorization
: {{<required>}} Provide this header with `Bearer <user token>` to gain authorized access to this API method.
##### Form data parameters
thumbnail
: Object. The custom thumbnail of the media to be attached, encoded using multipart form data.
description
: String. A plain-text description of the media, for accessibility purposes.
focus
: String. Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0. See [Focal points for cropping media thumbnails]({{< relref "api/guidelines#focal-points" >}}) for more information.
3.1.3 - deprecated in favor of [POST /api/v2/media](#v2), which is equal to v1 in all aspects, except it returns HTTP 202, and the returned JSON object has a url of null. This is because while the thumbnail is prepared synchronously, the full version of the media attachment will be processed in the background.\
3.2.0 - add `thumbnail` parameter
#### Request
##### Headers
Authorization
: {{<required>}} Provide this header with `Bearer <user token>` to gain authorized access to this API method.
##### Form data parameters
file
: {{<required>}} Object. The file to be attached, encoded using multipart form data. The file must have a MIME type.
thumbnail
: Object. The custom thumbnail of the media to be attached, encoded using multipart form data.
description
: String. A plain-text description of the media, for accessibility purposes.
focus
: String. Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0. See [Focal points for cropping media thumbnails]({{< relref "api/guidelines#focal-points" >}}) for more information.
#### Response
##### 200: OK
Attachment created successfully. Note that the MediaAttachment will be created even if the file is not understood correctly due to failed processing.