Skip to content

API Overview

Scry provides REST APIs for uploading and serving Storybook builds.

Services

ServiceBase URLPurpose
Upload Servicehttps://api.scry.comFile uploads, build tracking
CDN Servicehttps://view-{project}.scry.comFile serving

Authentication

Protected endpoints require an API key in the X-API-Key header:

bash
curl -H "X-API-Key: scry_proj_my-project_xxx" \
  https://api.scry.com/upload/my-project/v1.0.0

See Authentication for details.

Quick Reference

Upload Service

MethodEndpointAuthDescription
GET/healthNoHealth check
POST/upload/:project/:versionYesDirect upload
POST/presigned-url/:project/:version/:filenameYesGet presigned URL
GET/upload/:project/:versionNoGet file info

CDN Service

MethodEndpointAuthDescription
GET/healthNoHealth check
GET/*NoServe static files

Response Format

Success Response

json
{
  "success": true,
  "message": "Operation completed",
  "data": {
    // Response data
  }
}

Error Response

json
{
  "error": "Error type",
  "message": "Detailed error message"
}

HTTP Status Codes

CodeMeaning
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Server Error

Rate Limits

EndpointLimit
/upload/*100/minute per API key
/presigned-url/*100/minute per API key
/healthUnlimited
CDN filesUnlimited (cached at edge)

SDKs and Tools

CLI

The official CLI handles API communication:

bash
npx @scry/storybook-deployer --dir ./storybook-static

cURL Examples

bash
# Health check
curl https://api.scry.com/health

# Upload
curl -X POST \
  -H "X-API-Key: scry_proj_xxx" \
  -H "Content-Type: application/zip" \
  --data-binary @storybook.zip \
  https://api.scry.com/upload/my-project/v1.0.0

# Get presigned URL
curl -X POST \
  -H "X-API-Key: scry_proj_xxx" \
  -H "Content-Type: application/zip" \
  https://api.scry.com/presigned-url/my-project/v1.0.0/storybook.zip

API Reference

Released under the MIT License.