import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.slideshows.applySlideshowCommands({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
contentItemId: process.env.OCTOSPARK_CONTENT_ITEM_ID ?? "contentItemId",
body: {},
}){
"slideshow": {
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceContentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "<string>",
"payloadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"creativeHash": "<string>",
"currentCreativeHash": "<string>",
"renderedCreativeHash": "<string>",
"renderFresh": true,
"activeRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>"
},
"latestRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"errorCode": "<string>",
"diagnostics": "<string>"
},
"latestRenderJob": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>"
},
"project": {
"schemaVersion": 1,
"artifactKind": "slideshow",
"runtime": {
"rendererVersion": "<string>",
"remotionVersion": "<string>",
"reactVersion": "<string>",
"platform": "linux-arm64",
"entryPoint": "<string>",
"dependencyAllowlistVersion": "<string>"
},
"sourceFiles": [
{
"path": "<string>",
"contents": "<string>",
"sha256": "<string>"
}
],
"output": {
"width": 123,
"height": 123,
"fps": 30
},
"slides": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"durationFrames": 9000,
"posterFrame": 1,
"assetBindingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"textElements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"position": {
"x": 0,
"y": 0,
"width": 50000.5,
"height": 50000.5,
"rotation": 0
},
"styleId": "<string>",
"overrides": {
"fontWeight": 500,
"fontSize": 259,
"lineHeight": 2.25,
"letterSpacing": 32,
"fill": "<string>",
"strokeColor": "<string>",
"strokeWidth": 16,
"shadowColor": "<string>",
"shadowBlur": 64,
"shadowOffsetX": 0,
"shadowOffsetY": 0,
"panelColor": "<string>",
"panelOpacity": 0.5,
"padding": 128,
"borderRadius": 128,
"italic": true,
"opacity": 0.5,
"maxWidth": 2048.5
}
}
],
"backgroundBindingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundPresentation": {
"focalPoint": {
"x": 0.5,
"y": 0.5
},
"overlay": {
"color": "<string>",
"opacity": 0.5
}
},
"embeddedText": [
{
"text": "<string>"
}
]
}
],
"styles": {},
"assetBindings": {},
"styleContext": {
"renderTokens": {},
"references": [
{
"sourceId": "<string>",
"label": "<string>",
"sha256": "<string>"
}
]
}
},
"assetRefs": [
"<unknown>"
],
"links": {
"self": "<string>",
"revisions": "<string>",
"latestRenderJob": "<string>"
},
"browserPreviewUrl": "<string>",
"previewCreativeHash": "<string>"
},
"revision": {
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payloadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"creativeHash": "<string>",
"reversesRevision": 123,
"artifactRunId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actorType": "<string>",
"actorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commands": [
"<unknown>"
]
},
"run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"targetSlideId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"baseRevision": 123,
"resultRevision": 123,
"workflowId": "<string>",
"renderJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"diagnostics": "<string>",
"pauseReason": "<string>",
"maxSpendDecimillicents": 123,
"spentDecimillicents": 123,
"activeDurationMs": 123,
"links": {
"self": "<string>",
"events": "<string>",
"slideshow": "<string>"
}
}
}Apply slideshow commands
Edit a slideshow by describing what you want changed rather than sending a whole project. Immediate commands commit as the next revision and return it; background commands (image generation or search, image packs, custom components) queue one durable run and return it - several background image requests in one call become a single run that works through the slides in order. Pass the current expectedRevision and an Idempotency-Key.
import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.slideshows.applySlideshowCommands({
teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
contentItemId: process.env.OCTOSPARK_CONTENT_ITEM_ID ?? "contentItemId",
body: {},
}){
"slideshow": {
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceContentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"status": "<string>",
"payloadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"creativeHash": "<string>",
"currentCreativeHash": "<string>",
"renderedCreativeHash": "<string>",
"renderFresh": true,
"activeRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>"
},
"latestRun": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"errorCode": "<string>",
"diagnostics": "<string>"
},
"latestRenderJob": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>"
},
"project": {
"schemaVersion": 1,
"artifactKind": "slideshow",
"runtime": {
"rendererVersion": "<string>",
"remotionVersion": "<string>",
"reactVersion": "<string>",
"platform": "linux-arm64",
"entryPoint": "<string>",
"dependencyAllowlistVersion": "<string>"
},
"sourceFiles": [
{
"path": "<string>",
"contents": "<string>",
"sha256": "<string>"
}
],
"output": {
"width": 123,
"height": 123,
"fps": 30
},
"slides": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"durationFrames": 9000,
"posterFrame": 1,
"assetBindingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"textElements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"position": {
"x": 0,
"y": 0,
"width": 50000.5,
"height": 50000.5,
"rotation": 0
},
"styleId": "<string>",
"overrides": {
"fontWeight": 500,
"fontSize": 259,
"lineHeight": 2.25,
"letterSpacing": 32,
"fill": "<string>",
"strokeColor": "<string>",
"strokeWidth": 16,
"shadowColor": "<string>",
"shadowBlur": 64,
"shadowOffsetX": 0,
"shadowOffsetY": 0,
"panelColor": "<string>",
"panelOpacity": 0.5,
"padding": 128,
"borderRadius": 128,
"italic": true,
"opacity": 0.5,
"maxWidth": 2048.5
}
}
],
"backgroundBindingId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"backgroundPresentation": {
"focalPoint": {
"x": 0.5,
"y": 0.5
},
"overlay": {
"color": "<string>",
"opacity": 0.5
}
},
"embeddedText": [
{
"text": "<string>"
}
]
}
],
"styles": {},
"assetBindings": {},
"styleContext": {
"renderTokens": {},
"references": [
{
"sourceId": "<string>",
"label": "<string>",
"sha256": "<string>"
}
]
}
},
"assetRefs": [
"<unknown>"
],
"links": {
"self": "<string>",
"revisions": "<string>",
"latestRenderJob": "<string>"
},
"browserPreviewUrl": "<string>",
"previewCreativeHash": "<string>"
},
"revision": {
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payloadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 123,
"creativeHash": "<string>",
"reversesRevision": 123,
"artifactRunId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actorType": "<string>",
"actorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commands": [
"<unknown>"
]
},
"run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contentItemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"targetSlideId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"baseRevision": 123,
"resultRevision": 123,
"workflowId": "<string>",
"renderJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outputAssetId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errorCode": "<string>",
"diagnostics": "<string>",
"pauseReason": "<string>",
"maxSpendDecimillicents": 123,
"spentDecimillicents": 123,
"activeDurationMs": 123,
"links": {
"self": "<string>",
"events": "<string>",
"slideshow": "<string>"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
a string at most 200 character(s) long
1 - 200Path Parameters
Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.
Slideshow content item id (UUID), as returned by createSlideshow, createSlideshowGeneration, or listSlideshows.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$