1
0
mirror of https://github.com/mastodon/documentation synced 2025-04-11 22:56:17 +02:00

Add documentation for Mastodon API version 4 media deletion methods (#1605)

* Add documentation for `delete_media` parameter to `DELETE /api/v1/statuses/:id`

* Add documentation for `DELETE /api/v1/media/:id`

* It's actually version 4

* It's actually version 4
This commit is contained in:
Claire 2025-03-04 09:47:39 +01:00 committed by GitHub
parent cf4ae51888
commit c88771d7a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 33 additions and 2 deletions

View File

@ -261,6 +261,31 @@ There was an error processing the media attachment
---
## Delete media attachment {#delete}
```http
DELETE /api/v1/media/:id
```
Delete a media attachment that is not currently attached to a status.
**Returns:** Empty\
**OAuth:** User token + `write:media`\
**Version history:**\
- 4.4.0 (`mastodon` [API version]({{< relref "entities/Instance#api-versions" >}}) 4) - added
#### Request
##### Path parameters
:id
: {{<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.
## Update media attachment {#update}
```http

View File

@ -377,10 +377,16 @@ Delete one of your own statuses.
**OAuth:** User token + `write:statuses`\
**Version history:**\
0.0.0 - added\
2.9.0 - return source properties, for use with delete and redraft
2.9.0 - return source properties, for use with delete and redraft\
4.4.0 (`mastodon` [API version]({{< relref "entities/Instance#api-versions" >}}) 4) - added `delete_media` optional parameter
#### Request
##### Query parameters
delete_media
: Boolean. Whether to immediately delete the post's media attachments. If omitted or `false`, media attachments may be kept for approximately 24 hours so they can be re-used in a new post.
##### Path parameters
:id