PublishQPublishQ

Move media

POST
/media/move

Move media files to a folder, or to the top level with folderPath: null. Moving files into a folder that does not exist yet creates it. Folder names ignore capitals, so a path that differs only in capitals from an existing folder is refused with 409. Posts use media ids, so moving a file never changes a post.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

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

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://publishq.com/api/v1/media/move" \  -H "Content-Type: application/json" \  -d '{    "ids": [      "f6370ca1-1f47-4f68-be72-c1206913b326"    ],    "folderPath": "Channel A/Shorts"  }'
{
  "movedCount": 1
}
{
  "error": {
    "title": "Bad Request",
    "status": 400,
    "code": "validation_failed",
    "message": "Folder name cannot be empty",
    "instance": "/api/v1/media"
  }
}

{
  "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/move"
  }
}
{
  "error": {
    "title": "Conflict",
    "status": 409,
    "code": "media_folder_exists",
    "message": "A folder named \"Channel A\" already exists. Folder names ignore capitals, so use \"Channel A\" or pick another name.",
    "instance": "/api/v1/media"
  }
}
{
  "error": {
    "title": "Too Many Requests",
    "status": 429,
    "code": "rate_limit_exceeded",
    "message": "Too Many Requests",
    "instance": "/api/v1/media/move",
    "details": {
      "retryAfter": 60
    }
  }
}