Files
animethemes-api-docs/docs/jsonapi/reference/content/audio/update/index.md
T
2025-12-17 22:53:18 -03:00

55 lines
1.1 KiB
Markdown

---
title: Audio Update
---
# Audio Update Endpoint
The audio update endpoint updates an audio and returns the updated audio resource.
For example, the `/audio/Bakemonogatari-OP1.ogg?` endpoint will update the Bakemonogatari-OP1.ogg audio and return the updated Bakemonogatari-OP1.ogg resource.
## URL
```sh
PUT|PATCH /audio/{basename}
```
## Authentication
**Required Permission**: update audio
**Roles with Permission**: Content Moderator, Encoder, Admin
**Other Requirements**: Audio must not be soft deleted
## Parameters
| Name | Required | Rules |
| :--------: | :------: | :------------------------------------- |
## Response
```json
{
audio: {
id: id,
basename: "basename",
filename: "filename",
path: "path",
size: size,
mimetype: "mimetype",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link",
views_count: views_count
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/audio/Bakemonogatari-OP1.ogg
```