# Ssemble API Documentation
## Base URL
`https://aiclipping.ssemble.com/api/v1`
## Authentication
Include your API key in every request using one of these headers:
- `X-API-Key: sk_ssemble_your_key`
- `Authorization: Bearer sk_ssemble_your_key`
API keys are generated from the Ssemble dashboard at https://app.ssemble.com (Settings → API Keys).
---
## Endpoints
### 1. GET /templates
Returns available caption templates.
**Response:**
```json
{
"data": {
"templates": [
{
"templateId": "6aeaac3d8de2903b008563b1",
"name": "Letterbox",
"displayName": "Letterbox",
"thumbnail": "",
"order": -1,
"preview": "https://...",
"gif": ""
},
{
"templateId": "660b8531aedb346bbe26eb43",
"name": "karaoke",
"displayName": "Karaoke",
"thumbnail": "https://...",
"order": 1,
"preview": "https://...",
"gif": "https://..."
}
],
"defaultTemplateId": "660b8531aedb346bbe26eb43",
"defaultTemplateName": "karaoke"
}
}
```
**Letterbox template** (`6aeaac3d8de2903b008563b1`): clip centered in a black frame, hook title above the clip, captions inside the clip near its bottom. The API does not apply the web app's Letterbox defaults; for the same look send `layout: "fit"`, `blurBackground: false`, `backgroundColor: "#000000"`, `hookTitle: true`, `hookTitlePresetId: "native"`.
---
### 2. POST /shorts/create
Create a new video short. Consumes 1 credit.
**Request body:**
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| url | string | Yes* | — | YouTube video URL (required if fileUrl not provided) |
| fileUrl | string | Yes* | — | Direct video file URL (required if url not provided) |
| start | number | Yes | — | Start time in seconds (non-negative) |
| end | number | Yes | — | End time in seconds (must be > start) |
| preferredLength | string | No | under60sec | Options: under30sec, under60sec, under90sec, under3min, under5min, under10min |
| language | string | No | en | ISO 639-1 code. Supported: en, es, fr, de, it, pt, ru, ja, ko, zh, ar, hi, tr, pl, nl, sv, no, da, fi, cs, vi, id, fa, uk, af, ca, et, fo, gl, is, ms, sq, sw, tl, ro, sk, hr, sl, hu, lv, lt, bs, az, bg, mk, sr, mt, el, ne, mr, ka, hy, ur, he |
| captionLanguage | string | No | — | Caption language if different from video |
| templateId | string | No | default | Template ID from GET /templates (24-char hex) |
| noClipping | boolean | No | false | Process entire range without AI clipping |
| captionsEnabled | boolean | No | true | Burn captions into clips; false for sources that already have captions |
| hookTitle | boolean | No | false | Add hook title overlay |
| hookTitlePresetId | string | No | classic-pill | Hook title style (needs hookTitle=true): classic-pill, dark-pill, bold-outline, classic, native = Regular style, custom = your own design in hookTitleStyle (until the CTA, or hookTitleDuration); editorial, statement (animate in, leave after ~4s). List: GET /hook-title-presets |
| hookTitleStyle | object | With custom | - | Required when hookTitlePresetId is custom, not allowed otherwise. { shape: pill|box|plain (required), fontId (GET /hook-title-fonts, default montserrat-black), fontSize (pill 30-90, box 24-64, plain 36-90), textColor (hex), backgroundColor (hex; pill also "none"), outlineWidth (0-12, pill), outlineColor (hex, pill), cornerRadius (pill 0-60, box 0-40), textCase (upper|asis) } |
| hookTitleDuration | number | No | whole clip | Seconds the hook title stays on screen (needs hookTitle=true), e.g. 3, 5, 10; must be > 0. Hook is always hidden while the CTA shows. Ignored by editorial and statement (~4s) |
| memeHook | boolean | No | false | Add meme hook clip at beginning |
| memeHookName | string | No | random | Specific meme hook name from GET /meme-hooks |
| gameVideo | boolean | No | false | Add gameplay overlay (split-screen) |
| gameVideoName | string | No | random | Specific game video name from GET /game-videos |
| music | boolean | No | false | Add background music |
| musicName | string | No | random | Specific music track name from GET /music |
| musicNames | string[] | No | — | Up to 20 track names from GET /music; each short uses one at random (instead of musicName) |
| musicVolume | number | No | 10 | Music volume (0–100), only when music=true |
| ctaEnabled | boolean | No | false | Add call-to-action overlay |
| ctaText | string | Conditional | — | Required when ctaEnabled=true |
| layout | string | No | auto | Options: auto, fill, fit, square, split. split is for gaming streams with a face cam: the face cam on top, the gameplay below; clips where no face cam is found use auto |
| blurBackground | boolean | No | account preference (true) | Background behind the clip when it doesn't fill the frame (mainly layout=fit): true = blurred video, false = solid color (backgroundColor, else saved color, else template color) |
| backgroundColor | string | No | saved color, else template color | Solid background hex color like #000000; only with blurBackground=false (else 400) |
| outroEnabled | boolean | No | false | Append an end-screen outro card (bell animation + "Please subscribe") after each clip |
| outroText | string | No | localized "Please subscribe" | Custom outro text (max 80 chars); requires outroEnabled=true |
| outroImageUrl | string | No | stock card | Public image URL for a custom outro card; requires outroEnabled=true |
| outroSeconds | integer | No | 2 | Outro length in seconds (1-3); requires outroEnabled=true |
| outroSting | boolean | No | true | Play the bell sound on the outro; requires outroEnabled=true |
| outroHandle | string | No | — | Channel handle shown on the card, e.g. @mychannel (max 40 chars); requires outroEnabled=true |
| includeSourceLink | boolean | No | — | When these clips are later scheduled from the Ssemble web app, end each caption with "Source: " (customSourceLink, else the original YouTube video). Omit to use the account's last scheduler choice |
| customSourceLink | string | No | original video | Own link for the Source line (max 300 chars, https:// added if missing); requires includeSourceLink=true |
**Example request:**
```json
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"start": 0,
"end": 600,
"preferredLength": "under60sec",
"language": "en",
"music": true,
"musicVolume": 15,
"layout": "auto"
}
```
**Response:**
```json
{
"data": {
"requestId": "665a1b2c3d4e5f6a7b8c9d0e",
"status": "processing",
"creditsUsed": 1,
"estimatedCompletionTime": "2024-06-01T12:30:00.000Z",
"queuePosition": null
}
}
```
**Constraints:**
- Max time window: 20 minutes (1200 seconds)
- Max video duration: 5 hours
- YouTube Shorts URLs not supported
---
### 3. GET /shorts/:id/status
Check processing status.
**Response:**
```json
{
"data": {
"_id": "665a1b2c3d4e5f6a7b8c9d0e",
"status": "processing",
"progress": 40,
"userEmail": "user@example.com",
"failureReason": null,
"isDemo": false
}
}
```
Status values: queued, processing, completed, failed, cancelled.
Poll every 10 seconds until completed or failed.
---
### 4. GET /shorts/:id
Retrieve generated shorts with video URLs.
**Response:**
```json
{
"data": {
"_id": "665a1b2c3d4e5f6a7b8c9d0e",
"status": "completed",
"progress": 100,
"shorts": [
{
"id": 1,
"title": "The Most Viral Moment",
"reason": "High engagement potential",
"description": "Speaker discusses key insight",
"viral_score": 85,
"video_url": "https://storage.example.com/short-1.mp4",
"startTimestamp": 120,
"endTimestamp": 175,
"duration": 55,
"width": 1080,
"height": 1920,
"recompiling": false,
"error": false,
"errorMessage": null,
"posts": []
}
]
}
}
```
Each short also carries a posts array: the social posts made from it (see GET /posts for the shape).
---
### 5. GET /shorts
List all requests with pagination.
**Query params:** page (default 1), limit (default 20, max 100), status (filter), sortBy (createdAt|updatedAt), sortOrder (asc|desc)
**Response:**
```json
{
"data": {
"requests": [
{
"requestId": "...",
"status": "completed",
"progress": 100,
"createdAt": "2024-06-01T12:00:00.000Z",
"updatedAt": "2024-06-01T12:25:00.000Z",
"url": "https://...",
"duration": 600
}
],
"pagination": { "page": 1, "limit": 20, "totalPages": 5, "totalCount": 42 }
}
}
```
---
### 5b. GET /posts
List your scheduled and published social posts (YouTube, Instagram, TikTok) with status, public URL, publish time and failure reason. Includes posts scheduled by hand and posts made by channel automation (source field). Poll with date=published&since= to collect links of posts that just went live.
**Query params:** page (default 1), limit (default 50, max 100), status (scheduled|processing|published|failed|canceled), platform (youtube|instagram|tiktok), source (manual|automation), requestId, shortId, since, until (ISO 8601), date (scheduled|published — which timestamp since/until apply to)
**Response:**
```json
{
"data": {
"posts": [
{
"id": "6ac8829c0000000000000001",
"platform": "youtube",
"status": "published",
"scheduledAt": "2026-10-09T06:15:00.000Z",
"publishedAt": "2026-10-09T06:15:02.827Z",
"url": "https://www.youtube.com/watch?v=cR9Ki-TtW-w",
"shortId": "a1581dd6-9f1c-4a7e-9b1a-2c3d4e5f6a7b",
"requestId": "6a8d8d41aefabd4ce4f5b66f",
"title": "Build a VM for VS Code",
"account": { "handle": "deepak anand" },
"source": "manual",
"error": null,
"errorCode": null,
"retryable": null,
"createdAt": "2026-10-09T05:50:12.000Z"
}
],
"pagination": { "page": 1, "limit": 50, "totalPages": 1, "totalCount": 1 }
}
}
```
Statuses: scheduled (queued), processing (uploading, or accepted by the platform and waiting for its URL — TikTok 1–3 min), published (url + publishedAt set), failed (error = plain-language reason, errorCode = auth_expired|daily_cap|account_restricted|account_not_eligible|media_rejected|video_missing|processing_timeout|rate_limited|unknown, retryable = whether rescheduling can fix it), canceled. The same posts array is attached to each short in GET /shorts/:id.
---
### 6. DELETE /shorts/:id
Delete a request and all generated shorts. Irreversible.
**Response:**
```json
{ "data": { "message": "Request successfully deleted" } }
```
---
### 7. GET /music
List available background music tracks. Use the name field as musicName in POST /shorts/create.
**Query params:** page, limit
**Response:**
```json
{
"data": {
"music": [{ "name": "Energetic Beat", "duration": 180 }],
"pagination": { "page": 1, "limit": 20, "totalPages": 3, "totalCount": 45 }
}
}
```
---
### 8. GET /game-videos
List available gameplay video overlays. Use the name field as gameVideoName in POST /shorts/create.
**Query params:** page, limit
**Response:**
```json
{
"data": {
"gameVideos": [{ "name": "Minecraft Parkour", "preview": "https://..." }],
"pagination": { "page": 1, "limit": 20, "totalPages": 2, "totalCount": 30 }
}
}
```
---
### 9. GET /meme-hooks
List available meme hook clips. Use the name field as memeHookName in POST /shorts/create.
**Query params:** page, limit
**Response:**
```json
{
"data": {
"memeHooks": [{ "name": "Wait For It", "preview": "https://..." }],
"pagination": { "page": 1, "limit": 20, "totalPages": 2, "totalCount": 25 }
}
}
```
---
### 10. GET /hook-title-presets
List the hook title styles. Use the id as hookTitlePresetId in POST /shorts/create (with hookTitle=true).
**Response:**
```json
{
"data": {
"hookTitlePresets": [{ "id": "editorial", "name": "Editorial", "animated": true, "lines": "parts", "wordLimits": { "kicker": 6, "hero": 6, "tail": 6 } }],
"default": "classic-pill"
}
}
```
---
### 11. GET /hook-title-fonts
List the fonts for hookTitleStyle.fontId (hookTitlePresetId custom).
**Response:**
```json
{
"data": {
"hookTitleFonts": [{ "id": "montserrat-black", "name": "Montserrat Black", "category": "sans", "previewUrl": "https://cf.ssemble.com/..." }],
"defaultStyle": { "shape": "pill", "fontId": "montserrat-black", "fontSize": 56, "textColor": "#FFFFFF", "backgroundColor": "#000000", "outlineWidth": 0, "outlineColor": "#000000", "cornerRadius": 40, "textCase": "upper" }
}
}
```
---
## Error Codes
| HTTP | Code | Description |
|------|------|-------------|
| 400 | invalid_request | Invalid parameters |
| 400 | invalid_youtube_url | Invalid or unsupported YouTube URL |
| 400 | video_too_long | Exceeds 5-hour limit |
| 401 | invalid_api_key | Missing or invalid API key |
| 402 | insufficient_credits | No credits remaining |
| 402 | subscription_required | Active subscription needed |
| 404 | resource_not_found | Resource does not exist |
| 429 | rate_limit_exceeded | Too many requests |
| 500 | internal_error | Server error |
Error response format:
```json
{ "error": { "code": "error_code", "message": "Description", "details": null } }
```
---
## Rate Limit Headers
Every response includes: X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Limit-Day, X-RateLimit-Remaining-Day, X-RateLimit-Reset.
---
## Quick Start (JavaScript)
```javascript
const API_KEY = 'sk_ssemble_your_key';
const BASE = 'https://aiclipping.ssemble.com/api/v1';
// 1. Create short
const res = await fetch(BASE + '/shorts/create', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY },
body: JSON.stringify({
url: 'https://www.youtube.com/watch?v=VIDEO_ID',
start: 0, end: 600,
preferredLength: 'under60sec',
language: 'en',
music: true, musicVolume: 10,
layout: 'auto'
})
});
const { data } = await res.json();
const requestId = data.requestId;
// 2. Poll status
let status = 'processing';
while (status !== 'completed' && status !== 'failed') {
await new Promise(r => setTimeout(r, 10000));
const s = await fetch(BASE + '/shorts/' + requestId + '/status',
{ headers: { 'X-API-Key': API_KEY } });
status = (await s.json()).data.status;
}
// 3. Get results
const shorts = await fetch(BASE + '/shorts/' + requestId,
{ headers: { 'X-API-Key': API_KEY } });
const results = (await shorts.json()).data.shorts;
console.log(results.map(s => ({ title: s.title, url: s.video_url })));
```