Delete media
Deletes a media file from your media library and from storage. Returns no body on success. A file attached to a draft or scheduled post, or used as its thumbnail, is refused with 409 until that post is published or deleted. Posts already published on a platform are not affected.
Authorization
ApiKeyAuth PublishQ API key sent as Authorization: Bearer pq_live_....
In: header
Path Parameters
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://publishq.com/api/v1/media/f6370ca1-1f47-4f68-be72-c1206913b326"{
"error": {
"title": "Unauthorized",
"status": 401,
"code": "missing_auth",
"message": "Missing Authorization header",
"instance": "/api/v1/posts"
}
}{
"error": {
"title": "Forbidden",
"status": 403,
"code": "insufficient_scope",
"message": "Missing required scope: media:write",
"instance": "/api/v1/media/f6370ca1-1f47-4f68-be72-c1206913b326"
}
}{
"error": {
"title": "Not Found",
"status": 404,
"code": "media_not_found",
"message": "Media not found",
"instance": "/api/v1/media"
}
}{
"error": {
"title": "Conflict",
"status": 409,
"code": "media_in_use",
"message": "This media is used in 1 post that has not published yet. Publish or delete that post before deleting this media.",
"instance": "/api/v1/media",
"details": {
"blockingPostCount": 1
}
}
}{
"error": {
"title": "Too Many Requests",
"status": 429,
"code": "rate_limit_exceeded",
"message": "Too Many Requests",
"instance": "/api/v1/media/f6370ca1-1f47-4f68-be72-c1206913b326",
"details": {
"retryAfter": 60
}
}
}Create media upload POST
Upload a file of up to 4 GB (500 MB on the Free plan) straight to storage: 1. Call this endpoint with `filename`, `contentType` and `fileSize`. You get back an `id` and an `uploadUrl`. 2. `PUT` the file to `uploadUrl` with the same `Content-Type` header. Storage answers `200`, or `403` if the file is not exactly `fileSize` bytes. 3. Optional: call Complete media upload to add the file to your media library now. 4. Put the `id` in `mediaIds` when you create or update a post.
Complete media upload POST
Optional. Adds a file uploaded through Create media upload to your media library now and returns it. Without this call the file is added the first time you use its id in a post, and an upload nobody completes or uses within 1 day expires.