Docs
Assets API
Assets API
Fetching auto-saved asset outputs from agent tool calls.
GET /api/assets
Fetch assets for the current team. All outputs from agent tool calls (images, posts, scripts, receipts, legal analyses) are automatically saved here.
Auth: Required
Query parameters (all optional):
| Param | Type | Description |
|---|---|---|
conversationId | string | Filter to a specific conversation |
type | string | Filter by asset type (see types below) |
from | ISO date string | Filter assets created after this date |
to | ISO date string | Filter assets created before this date |
limit | number | Max results, default 60, max 100 |
offset | number | Pagination offset, default 0 |
Response: Array of asset objects ordered by createdAt descending.
Asset Schema
{
id: number,
teamId: string,
conversationId: string | null,
runId: number | null, // set for workflow-generated assets
type: string,
title: string, // max 100 chars
content: string, // URL for images, Markdown for everything else
metadata: Record<string, unknown>,
createdAt: string,
}Asset Types
type | Produced By | content Format | Key metadata Fields |
|---|---|---|---|
social_post | format_post | The post text + hashtags | platform |
post_outline | generate_outline | Markdown outline | platform, outline (original JSON) |
image | generate_image | Supabase Storage public URL | prompt |
reel_script | format_reel | Caption + hashtags | platform, sceneCount |
script | format_script | Full script in Markdown | format, estimatedRuntime |
thumbnail | generate_thumbnail_concept | 3 concepts in Markdown | platform, conceptCount |
receipt | extract_receipt_data | Itemized receipt in Markdown | total, currency, itemCount |
legal_analysis | analyze_legal_document | Full analysis in Markdown | documentType, riskCount, highRisks |
Filtering Examples
# All images from a specific conversation
GET /api/assets?conversationId=abc123&type=image
# All receipts from the last 7 days
GET /api/assets?type=receipt&from=2025-05-03
# Paginate: second page of 20 results
GET /api/assets?limit=20&offset=20
# All assets from a workflow run
GET /api/assets?runId=42Assets are team-scoped. The endpoint automatically filters by team.id from the current session — users in multiple teams only see assets for their active team.