PublishQPublishQ

Delete media

DELETE
/media/{id}

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
AuthorizationBearer <token>

PublishQ API key sent as Authorization: Bearer pq_live_....

In: header

Path Parameters

id*string
Formatuuid

Response 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"
Empty

{
  "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
    }
  }
}