API Platform

Delete File

Delete the file record and its asset reference.

DELETE
/v1/files/{file_id}

Deletes the file record and its asset reference by file_id, returning a file object with deleted: true.

Authentication

Add Authorization: Bearer <API_KEY> to the request header to authenticate. You can generate a key on the "API Keys" page of the console.

Example
curl https://api.mosi.cn/v1/files \
  -H "Authorization: Bearer $MOSS_API_KEY"

Request parameters

Path parameterTypeRequiredDescription
file_idstringYes

The id returned by POST /v1/files.

Request example

Example
curl -X DELETE "https://api.mosi.cn/v1/files/<file_id>" \
  -H "Authorization: Bearer $MOSS_API_KEY"

Response fields

FieldTypeAlways returnedDescription
idstringYes

The id of the deleted file.

objectstringYes

Fixed as file.

deletedbooleanYes

Fixed as true, indicating a successful deletion.

Response example

Response example
{
  "id": "<file_id>",
  "object": "file",
  "deleted": true
}

Next steps