Skip to main content
The Configuration API allows you to manage platform settings programmatically. These settings override SDK defaults and take effect without app updates.

Endpoints

MethodEndpointDescription
GET/v1/configGet all configuration
GET/v1/config/{key}Get specific config
PUT/v1/config/{key}Update configuration
DELETE/v1/config/{key}Reset to default

Configuration categories

CategoryKeyDescription
PlaybackplaybackPlayer behavior settings
FeedfeedFeed ranking and display
CDNcdnContent delivery settings
AdsadsAdvertising configuration
Playback Restrictionsplayback-restrictionsDomain and security settings
ThemethemeUI theming (remote override)

Get all configuration

Retrieve the complete configuration for your organization.
GET /v1/config

Example request

curl https://api.shortkit.dev/v1/config \
  -H "Authorization: Bearer sk_live_your_secret_key"

Response

{
  "data": {
    "playback": {
      "autoplay": true,
      "muted": true,
      "loop": true,
      "preloadCount": 3,
      "maxBitrate": null,
      "preferredCodec": "auto"
    },
    "feed": {
      "pageSize": 20,
      "prefetchCount": 5,
      "refreshInterval": 300
    },
    "cdn": {
      "urlExpiry": 21600,
      "preferredEdge": "auto"
    },
    "ads": {
      "enabled": true,
      "frequency": {
        "mode": "count",
        "interval": 5,
        "firstAdAfter": 3
      }
    },
    "playback-restrictions": {
      "allowedDomains": ["yourcompany.com", "*.yourcompany.com"],
      "allowNoReferrer": false,
      "allowHighRiskUserAgents": false
    }
  },
  "meta": {
    "version": 12,
    "updatedAt": "2024-02-04T12:00:00Z"
  }
}

Get specific configuration

Retrieve a single configuration category.
GET /v1/config/{key}

Path parameters

key
string
required
Configuration category key.

Example request

curl https://api.shortkit.dev/v1/config/playback \
  -H "Authorization: Bearer sk_live_your_secret_key"

Response

{
  "data": {
    "autoplay": true,
    "muted": true,
    "loop": true,
    "preloadCount": 3,
    "maxBitrate": null,
    "preferredCodec": "auto"
  },
  "meta": {
    "version": 5,
    "updatedAt": "2024-02-01T10:00:00Z"
  }
}

Update configuration

Update settings for a configuration category.
PUT /v1/config/{key}

Playback configuration

curl -X PUT https://api.shortkit.dev/v1/config/playback \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "autoplay": true,
    "muted": true,
    "loop": true,
    "preloadCount": 5,
    "maxBitrate": 4000000,
    "preferredCodec": "av1"
  }'
autoplay
boolean
default:true
Auto-start playback when content is visible.
muted
boolean
default:true
Start playback muted.
loop
boolean
default:true
Loop video on completion.
preloadCount
integer
default:3
Number of videos to preload (1-10).
maxBitrate
integer
Maximum bitrate in bps. null for unlimited.
preferredCodec
string
default:"auto"
Preferred codec: auto, h264, av1.

Feed configuration

curl -X PUT https://api.shortkit.dev/v1/config/feed \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "pageSize": 20,
    "prefetchCount": 5,
    "refreshInterval": 300
  }'
pageSize
integer
default:20
Items per feed request (10-50).
prefetchCount
integer
default:5
Items to prefetch ahead (1-10).
refreshInterval
integer
default:300
Auto-refresh interval in seconds (60-3600).

CDN configuration

curl -X PUT https://api.shortkit.dev/v1/config/cdn \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "urlExpiry": 21600,
    "preferredEdge": "auto"
  }'
urlExpiry
integer
default:21600
Signed URL expiry in seconds (3600-86400).
preferredEdge
string
default:"auto"
Preferred edge location: auto, us, eu, asia.

Ads configuration

curl -X PUT https://api.shortkit.dev/v1/config/ads \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "frequency": {
      "mode": "count",
      "interval": 5,
      "firstAdAfter": 3
    },
    "testMode": false
  }'
enabled
boolean
default:false
Enable in-feed advertising.
frequency
object
Ad frequency settings.
testMode
boolean
default:false
Show test ads only.

Playback restrictions

curl -X PUT https://api.shortkit.dev/v1/config/playback-restrictions \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "allowedDomains": ["yourcompany.com", "*.yourcompany.com"],
    "allowNoReferrer": true,
    "allowHighRiskUserAgents": false
  }'
allowedDomains
string[]
required
Domains allowed to play content.
allowNoReferrer
boolean
default:false
Allow requests without referrer header.
allowHighRiskUserAgents
boolean
default:false
Allow known bot/scraper user agents.

Response

{
  "data": {
    "autoplay": true,
    "muted": true,
    "loop": true,
    "preloadCount": 5,
    "maxBitrate": 4000000,
    "preferredCodec": "av1"
  },
  "meta": {
    "version": 6,
    "updatedAt": "2024-02-04T12:00:00Z",
    "previousVersion": 5
  }
}

Reset configuration

Reset a configuration category to defaults.
DELETE /v1/config/{key}

Example request

curl -X DELETE https://api.shortkit.dev/v1/config/playback \
  -H "Authorization: Bearer sk_live_your_secret_key"

Response

{
  "data": {
    "reset": true,
    "defaults": {
      "autoplay": true,
      "muted": true,
      "loop": true,
      "preloadCount": 3,
      "maxBitrate": null,
      "preferredCodec": "auto"
    }
  }
}

Configuration versioning

Each configuration update creates a new version:
curl https://api.shortkit.dev/v1/config/playback/versions \
  -H "Authorization: Bearer sk_live_your_secret_key"
{
  "data": [
    {
      "version": 6,
      "updatedAt": "2024-02-04T12:00:00Z",
      "updatedBy": "[email protected]"
    },
    {
      "version": 5,
      "updatedAt": "2024-02-01T10:00:00Z",
      "updatedBy": "[email protected]"
    }
  ]
}

Rollback to previous version

curl -X POST https://api.shortkit.dev/v1/config/playback/rollback \
  -H "Authorization: Bearer sk_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{ "version": 5 }'

SDK sync

SDKs fetch configuration on initialization and periodically refresh:
shortkit.initialize({
  apiKey: 'pk_live_...',
  config: {
    refreshInterval: 300000  // Check every 5 minutes
  }
});

// Force refresh
await shortkit.refreshConfig();

// Get current config
const config = shortkit.getConfig();
Configuration changes take effect on next SDK refresh (typically within 5 minutes).

Best practices

Always validate configuration changes in staging before applying to production.
For significant changes, use A/B testing to roll out to a subset of users first.
Watch analytics after configuration changes to detect any negative impact.
Keep a changelog of configuration updates for troubleshooting.

Next steps