Skip to content

Move Files ​

PUThttps://api.repliz.com/public/storage/file/folder

Move files into a folder, or out of their folder. The file URLs stay the same, so posts that already use the files keep working.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): storage:write
  • Access Tier: Addon Storage

Request Body ​

FieldTypeRequiredDescription
fileIdsarrayYesIDs of the files to move, from 1 to 100.
folderIdstring | nullNoFolder to move the files into, the _id from Get Folder. Send null or leave it out to take the files out of their folder.

Example Request ​

bash
curl -X PUT "https://api.repliz.com/public/storage/file/folder" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "fileIds": ["680affa5ce12f2f72916f67e", "680affa5ce12f2f72916f67a"],
    "folderId": "6a4c3b580afd72bb342c3886"
  }'
javascript
import axios from 'axios';

const response = await axios.put(
  'https://api.repliz.com/public/storage/file/folder',
  {
    fileIds: ['680affa5ce12f2f72916f67e', '680affa5ce12f2f72916f67a'],
    folderId: '6a4c3b580afd72bb342c3886',
  },
  {
    auth: {
      username: 'YOUR_ACCESS_KEY',
      password: 'YOUR_SECRET_KEY',
    },
  },
);

console.log(response.status);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const response = await fetch('https://api.repliz.com/public/storage/file/folder', {
  method: 'PUT',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fileIds: ['680affa5ce12f2f72916f67e', '680affa5ce12f2f72916f67a'],
    folderId: '6a4c3b580afd72bb342c3886',
  }),
});

console.log(response.status);

Response ​

json
// No content returned on success
json
{
  "code": 404,
  "message": "folder not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}

404 file not found means none of the fileIds belong to your storage.