POST
/
v1
/
teams
/
{teamId}
/
assets
/
import
TypeScript client
import { OctosparkClient } from '@octospark/sdk'

const client = new OctosparkClient({
  token: process.env.OCTOSPARK_TOKEN
})

const response = await client.assets.importAsset({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  body: {},
})
{
  "asset": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "originalFilename": "<string>",
    "fileSize": 123,
    "mimeType": "<string>",
    "assetTypeData": {
      "type": "image",
      "width": 123,
      "height": 123,
      "format": "<string>",
      "colorSpace": "<string>",
      "aspectRatio": "<string>"
    },
    "storagePath": "<string>",
    "thumbnailPath": "<string>",
    "aiTitle": "<string>",
    "aiDescription": "<string>",
    "aiTags": [
      "<string>"
    ],
    "contentHash": "<string>",
    "processingError": "<string>",
    "isDeleted": true,
    "deletedAt": "<string>",
    "hardDeletedAt": "<string>",
    "sharedWithOrg": true,
    "folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "folderName": "<string>",
    "displayName": "<string>",
    "aspectRatio": "<string>",
    "isProcessing": true,
    "createdAt": "<string>",
    "updatedAt": "<string>"
  },
  "deduplicated": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

teamId
string
required

Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.

Body

application/json
sourceUrl
string

Public http(s) URL the server fetches the file from (SSRF-guarded, max 200 MB); mutually exclusive with contentBase64.

Minimum string length: 1
Example:

"https://example.com/media/launch-teaser.png"

contentBase64
string

Base64-encoded file content for small payloads, max 10 MB decoded; mutually exclusive with sourceUrl, and requires fileName and mimeType.

Minimum string length: 1
Example:

"iVBORw0KGgoAAAANSUhEUg..."

fileName
string

Filename to store the asset under, including extension; required with contentBase64, otherwise derived from sourceUrl.

Minimum string length: 1
Example:

"launch-teaser.png"

mimeType
string

MIME type of the imported content; required with contentBase64, otherwise inferred from the fetch response.

Minimum string length: 1
Example:

"image/png"

folderId
string<uuid>

Folder to place the newly imported asset in; must exist and belong to the team. Omit to land the asset at the team root.

Pattern: ^[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}$

Response

Success

asset
object
required
deduplicated
boolean
required