POST
/
boxes
/
{boxId}
/
media
/
albums
JavaScript
import GboxSDK from "gbox-sdk";
import fs from "fs";

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});

async function main() {
  const box = await gboxSDK.create({ type: "android" });

  // Create a new album with media files
  const album = await box.media.createAlbum({
    name: "vacation-2024",
    media: [
      "/path/to/photo1.jpg",
      "/path/to/photo2.jpg",
    ]
  });

  console.log(`✅ Album created: ${album.data.name}`);

}

main();
{
  "name": "Vacation Photos",
  "path": "/sdcard/albums/vacation",
  "lastModified": "2021-01-01T00:00:00Z",
  "mediaCount": 15
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Body

multipart/form-data

Album creation with media files (max size: 512MB per file)

Request to create a new album with uploaded media files

Response

201 - application/json

Album created successfully

Album representation