sirv-api

Sirv REST API integration for image and file management. Use when working with Sirv CDN, uploading/downloading files to Sirv, managing image metadata, searching files, creating 360 spins, converting videos, or any Sirv API operations. Covers authentication, file operations, metadata, search queries, async jobs, and account management.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "sirv-api" with this command: npx skills add igorvaryvoda/image-optimization-skill/igorvaryvoda-image-optimization-skill-sirv-api

Sirv REST API

Base URL: https://api.sirv.com

Authentication

All requests require a Bearer token from /v2/token:

curl -X POST https://api.sirv.com/v2/token \
  -H "Content-Type: application/json" \
  -d '{"clientId": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET"}'

Response:

{"token": "eyJhbG...", "expiresIn": 1200, "scope": ["account:read", ...]}

Use token in subsequent requests:

curl https://api.sirv.com/v2/account \
  -H "Authorization: Bearer eyJhbG..."

Tokens expire in 20 minutes. Request a new one before expiry.

Quick Reference

File Operations

OperationMethodEndpointKey Params
UploadPOST/v2/files/upload?filename=/path/file.jpg + binary body
DownloadGET/v2/files/download?filename=/path/file.jpg
DeletePOST/v2/files/delete?filename=/path/file.jpg
CopyPOST/v2/files/copy?from=/a.jpg&to=/b.jpg
Rename/MovePOST/v2/files/rename?from=/a.jpg&to=/b.jpg
Create folderPOST/v2/files/mkdir?dirname=/new-folder
List directoryGET/v2/files/readdir?dirname=/folder

Metadata Operations

OperationMethodEndpoint
Get all metaGET/v2/files/meta?filename=/path
Set metaPOST/v2/files/meta?filename=/path
Get/Set titleGET/POST/v2/files/meta/title?filename=/path
Get/Set descriptionGET/POST/v2/files/meta/description?filename=/path
Get/Add/Delete tagsGET/POST/DELETE/v2/files/meta/tags?filename=/path
Get/Set productGET/POST/v2/files/meta/product?filename=/path

Async Jobs (return job ID, poll for progress)

OperationStartPoll
Spin to videoPOST /v2/files/spin2videoReturns filename directly
Video to spinPOST /v2/files/video2spinReturns filename directly
Create ZIPPOST /v2/files/zipGET /v2/files/zip?id=
Batch deletePOST /v2/files/batch/deleteGET /v2/files/batch/delete?id=
3D to GLBPOST /v2/files/3d/model2GLBGET /v2/files/3d/model2GLB?id=

When to Read Reference Files

  • File operations (upload, download, copy, delete, directory listing): See files.md
  • Metadata & search (meta fields, search query syntax, product data): See metadata.md
  • Async jobs (video conversion, ZIP, batch ops): See jobs.md
  • Account & stats (usage, billing, events, settings): See account.md

Common Patterns

Upload an image

const token = await getToken();
await fetch('https://api.sirv.com/v2/files/upload?filename=/images/photo.jpg', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'image/jpeg'
  },
  body: imageBuffer
});

Search for recent images

await fetch('https://api.sirv.com/v2/files/search', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: 'extension:.jpg AND mtime:[now-7d TO now]',
    size: 50
  })
});

Create ZIP archive (async)

// Start job
const { id } = await fetch('https://api.sirv.com/v2/files/zip', {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    filenames: ['/images/photo1.jpg', '/images/photo2.jpg'],
    zipFilename: '/downloads/photos.zip'
  })
}).then(r => r.json());

// Poll until complete
let progress = 0;
while (progress < 100) {
  const status = await fetch(`https://api.sirv.com/v2/files/zip?id=${id}`, {
    headers: { 'Authorization': `Bearer ${token}` }
  }).then(r => r.json());
  progress = status.progress;
  await new Promise(r => setTimeout(r, 1000));
}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

image-optimization

No summary provided by upstream source.

Repository SourceNeeds Review
General

sirv-dynamic-imaging

No summary provided by upstream source.

Repository SourceNeeds Review
General

sirv-ai-studio

No summary provided by upstream source.

Repository SourceNeeds Review