Skip to main content
GET
/
api
/
partner
/
v1
/
files
import fetch from "node-fetch";

const response = await fetch(
  "https://www.genviral.io/api/partner/v1/files?limit=20",
  {
    headers: {
      Authorization: "Bearer <token>",
    },
  }
);

const { data } = await response.json();
console.log(`Found ${data.total} files`);
data.files.forEach((file) => {
  console.log(`${file.filename}: ${file.url}`);
});
{
  "ok": true,
  "code": 200,
  "message": "Files retrieved",
  "data": {
    "files": [
      {
        "id": "abc123",
        "url": "https://cdn.vireel.io/partner-api/ws_123/abc123.mp4",
        "contentType": "video/mp4",
        "filename": "promo-video.mp4",
        "size": 15728640,
        "createdAt": "2025-01-20T14:30:00.000Z"
      },
      {
        "id": "def456",
        "url": "https://cdn.vireel.io/partner-api/ws_123/def456.jpg",
        "contentType": "image/jpeg",
        "filename": "slide-1.jpg",
        "size": 524288,
        "createdAt": "2025-01-20T14:25:00.000Z"
      }
    ],
    "total": 42,
    "limit": 20,
    "offset": 0
  }
}
Retrieve a paginated list of all files uploaded via the Partner API for your workspace.

Query Parameters

limit
number
default:"50"
Number of files to return (max 100).
offset
number
default:"0"
Number of files to skip for pagination.
type
string
Filter by file type: image or video.

Response

Successful requests return 200 with:
  • files - Array of file objects
  • total - Total count of matching files
  • limit - Applied limit
  • offset - Applied offset

File Object

FieldTypeDescription
idstringUnique file identifier
urlstringCDN URL for the file
contentTypestringMIME type of the file
filenamestringOriginal filename
sizenumberFile size in bytes
createdAtstringISO 8601 timestamp

Examples

List all files

import fetch from "node-fetch";

const response = await fetch(
  "https://www.genviral.io/api/partner/v1/files?limit=20",
  {
    headers: {
      Authorization: "Bearer <token>",
    },
  }
);

const { data } = await response.json();
console.log(`Found ${data.total} files`);
data.files.forEach((file) => {
  console.log(`${file.filename}: ${file.url}`);
});
# List all files
curl --request GET \
  --url 'https://www.genviral.io/api/partner/v1/files?limit=20' \
  --header 'Authorization: Bearer <token>'

# List only videos
curl --request GET \
  --url 'https://www.genviral.io/api/partner/v1/files?type=video&limit=10' \
  --header 'Authorization: Bearer <token>'

# Paginate through results
curl --request GET \
  --url 'https://www.genviral.io/api/partner/v1/files?limit=20&offset=20' \
  --header 'Authorization: Bearer <token>'
{
  "ok": true,
  "code": 200,
  "message": "Files retrieved",
  "data": {
    "files": [
      {
        "id": "abc123",
        "url": "https://cdn.vireel.io/partner-api/ws_123/abc123.mp4",
        "contentType": "video/mp4",
        "filename": "promo-video.mp4",
        "size": 15728640,
        "createdAt": "2025-01-20T14:30:00.000Z"
      },
      {
        "id": "def456",
        "url": "https://cdn.vireel.io/partner-api/ws_123/def456.jpg",
        "contentType": "image/jpeg",
        "filename": "slide-1.jpg",
        "size": 524288,
        "createdAt": "2025-01-20T14:25:00.000Z"
      }
    ],
    "total": 42,
    "limit": 20,
    "offset": 0
  }
}

Error Responses

  • 500 list_failed - Failed to retrieve files (retry)
Use the type filter to quickly find videos or images when building slideshows or selecting media for posts.