API Reference: Media Library
Read a Team native Media Library discovery status and permission-filtered duplicate File groups.
Overview
The Media Library API is a read-only discovery surface for the platform's native Digital Asset Management feature: a per-Team media-library Blueprint that turns trusted Files into ordinary DataRecords (see Files for uploads). Both endpoints require active selected-Team access and the files:read OAuth scope. Neither endpoint installs or upgrades anything for the Team — that happens automatically the first time the Team has a trusted File, and later when the platform ships an additive Blueprint update.
Key Concepts
- Status —
DISABLED(the feature is off platform-wide),NOT_PROVISIONED(no trusted File has installed the Blueprint for this Team yet),MANAGED_TEAM(a production-managed or Environment-Promotion-topology Team, which is never auto-installed or auto-upgraded), orREADY. - Collection/DataField Simply IDs — Once
READY, the response names the installedmedia/albumsCollection Simply IDs and their DataField Simply IDs keyed by field name (file,title,caption,credit, and so on), so a client can read/write Media records through the ordinary Data Records and Data Views APIs without hardcoding IDs. - Data Views — A persisted Gallery Data View (
mediaGallerySimplyId) and Albums Data View (albumsSimplyId), each usable with the Data Views API.viewsisnulluntil the Team's installed Blueprint version includes them (a one-time, automatic platform upgrade with no visible effect on existing data). - Duplicate groups — Files whose most current version shares the same content hash. Each File in a group carries its Media record Simply ID when the library is installed and that File is registered.
Get Media Library Status
GET /v1/media-library returns the selected Team's discovery info.
TypeScript SDK
const status = await s360.mediaLibrary.get();
if (status.data.status === 'READY') {
console.log('Media collection:', status.data.media?.collectionSimplyId);
console.log('Gallery view:', status.data.views?.mediaGallerySimplyId ?? 'not upgraded yet');
}
cURL
curl -s "https://api.simply360.app/v1/media-library" \
-H "Authorization: Bearer $S360_API_KEY"
Example Response
{
"data": {
"enabled": true,
"status": "READY",
"installedVersion": "1.1.0",
"media": {
"collectionSimplyId": "COLL-0000-0001",
"fieldSimplyIds": { "file": "FLD0-0000-0001", "title": "FLD0-0000-0002" }
},
"albums": {
"collectionSimplyId": "COLL-0000-0002",
"fieldSimplyIds": { "name": "FLD0-0000-0010" }
},
"mediaStatuses": { "collectionSimplyId": "COLL-0000-0003" },
"views": { "mediaGallerySimplyId": "VIEW-0000-0001", "albumsSimplyId": "VIEW-0000-0002" }
},
"meta": { "requestId": "..." }
}
List Duplicate Files
GET /v1/media-library/duplicates lists permission-filtered groups of Files that share a current-version content hash, paginated by group (not by File). limit defaults to 20 and caps at 50; offset defaults to 0.
TypeScript SDK
const duplicates = await s360.mediaLibrary.listDuplicates({ limit: 20, offset: 0 });
for (const group of duplicates.data) {
console.log(group.sourceSha256, group.files.map((file) => file.fileSimplyId));
}
console.log(`${duplicates.meta.pagination.total} duplicate group(s) total`);
cURL
curl -s "https://api.simply360.app/v1/media-library/duplicates?limit=20&offset=0" \
-H "Authorization: Bearer $S360_API_KEY"
Example Response
{
"data": [
{
"sourceSha256": "a1b2c3...",
"files": [
{ "fileSimplyId": "FILE-0001-0001", "filename": "logo.png", "fileSizeBytes": 20481, "mimeType": "image/png", "mediaRecordSimplyId": "DREC-0000-0001" },
{ "fileSimplyId": "FILE-0001-0002", "filename": "logo-copy.png", "fileSizeBytes": 20481, "mimeType": "image/png", "mediaRecordSimplyId": null }
]
}
],
"meta": {
"requestId": "...",
"pagination": { "total": 1, "limit": 20, "offset": 0, "hasMore": false }
}
}
Check for an Identical File Before Uploading
GET /v1/media-library/files-by-hash?sha256=... returns up to 10 of your visible, non-deleted Files whose current version has exactly this content, oldest first. Pass the SHA-256 as 64 hex characters or base64 (the form trusted uploads declare). It is scope-filtered like GET /v1/files and never reveals another Team's content. The Media Library screen uses it to offer skipping an upload that is already in the library.
const { data } = await s360.mediaLibrary.findFilesByHash('n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg=');
if (data.files.length > 0) console.log(`Already uploaded as ${data.files[0].filename}`);
{
"data": {
"files": [
{ "fileSimplyId": "FILE-0001-0001", "filename": "logo.png", "fileSizeBytes": 20481, "mimeType": "image/png", "mediaRecordSimplyId": "DREC-0000-0001" }
]
},
"meta": { "requestId": "..." }
}
MCP Tools
Hosted MCP clients, TeamAgent, and the authenticated Team Knowledge chat assistant can call get_media_library (no input), list_media_duplicates ({ limit?, offset? }), and find_media_files_by_hash ({ sha256 }) for the same read-only data. All require files:read and are unavailable while the platform kill switch is off.
See Also
- Files — uploads, metadata, and download URLs.
- Data Records and Data Views — reading and writing Media/Album records once you have their Collection/DataField Simply IDs.
- MCP Server — general MCP tool usage.
Move or Add Files Between File Sets
Use the existing reviewed bulk record operation (previewBulkRecordOperation, then confirm). Existing album operation names and public field identifiers remain compatible. Select Media record Simply IDs and use an UPDATE command:
{
"kind": "UPDATE",
"relationshipMode": "MOVE",
"fields": { "ALBM-FILD-0001": ["DEST-ALBM-0001"] },
"relationshipRemovals": { "ALBM-FILD-0001": ["FROM-ALBM-0001"] }
}
Replace those example identities with the installed Media albums field and the source/destination record Simply IDs. MOVE requires edit permission for both source and destination. It updates both links in one transaction per file and retains other links. ADD omits relationshipRemovals and retains existing links.
SDK bulkRecordOperations.preview, MCP preview_bulk_record_operation, and Ask Simply use the same contract and permissions. Status itemResults identify each record: completed items include changeStatus CHANGED or UNCHANGED; failed items include a reason. A completed move retried against current state is unchanged.