Skip to content

Content Resources & Assets

Content resources represent files in your agent’s workspace — generated outputs (images, videos, audio) and manually uploaded assets. The asset library provides a unified view with folder organization, and direct upload lets you send files straight to S3 for maximum performance.

Returns a paginated list of content resources belonging to the agent. Results are ordered by most recent first.

GET /v1/content_resources
ParameterTypeRequiredDescription
agent_idintegerYesThe agent whose resources to list.
typestringNoFilter by file type: image, video, audio, zip, or safe_tensors.
project_idintegerNoFilter to resources attached to a specific project.
idsarrayNoReturn only resources matching these IDs.
pageintegerNoPage number for pagination (default 0, 20 items per page).
[
{
"id": 5012,
"url": "https://cdn.gen.pro/uploads/abc123.png",
"thumbnail_url": "https://cdn.gen.pro/uploads/abc123_thumb.png",
"file_name": "product-hero.png",
"content_type": "image/png"
},
{
"id": 5008,
"url": "https://cdn.gen.pro/uploads/def456.mp4",
"thumbnail_url": null,
"file_name": "intro-clip.mp4",
"content_type": "video/mp4"
}
]
Terminal window
# All resources for an agent
curl "https://api.gen.pro/v1/content_resources?agent_id=42" \
-H "X-API-Key: your-api-key"
# Only images, page 2
curl "https://api.gen.pro/v1/content_resources?agent_id=42&type=image&page=2" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
404not_foundAgent not found or not accessible.

Uploads a new file as a content resource. The file must be sent as a multipart form upload. Optionally place the resource in an asset folder.

POST /v1/content_resources
ParameterTypeRequiredDescription
agent_idintegerYesThe agent to create the resource under.
content_resource[file]fileYesThe file to upload (multipart). Accepted types: images, videos, audio, zip, safetensors.
asset_folder[id]integerNoPlace the resource inside this asset folder.
{
"content_resource": {
"id": 5013,
"url": "https://cdn.gen.pro/uploads/ghi789.png",
"thumbnail_url": "https://cdn.gen.pro/uploads/ghi789_thumb.png",
"file_name": "banner.png",
"content_type": "image/png"
},
"generator": null
}
Terminal window
curl -X POST "https://api.gen.pro/v1/content_resources?agent_id=42" \
-H "X-API-Key: your-api-key" \
-F "content_resource[file]=@/path/to/banner.png"
# With folder attachment
curl -X POST "https://api.gen.pro/v1/content_resources?agent_id=42" \
-H "X-API-Key: your-api-key" \
-F "content_resource[file]=@/path/to/banner.png" \
-F "asset_folder[id]=15"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to create resources for this agent.
422content_resource_creation_failedValidation failed (e.g., unsupported file type, missing file).

Returns a single content resource with full details, including the generating job if the resource was produced by an AI generation task.

GET /v1/content_resources/:id
ParameterTypeRequiredDescription
agent_idintegerYesThe agent that owns the resource.
idintegerYesThe content resource ID (path parameter).
{
"content_resource": {
"id": 5012,
"url": "https://cdn.gen.pro/uploads/abc123.png",
"thumbnail_url": "https://cdn.gen.pro/uploads/abc123_thumb.png",
"file_name": "product-hero.png",
"content_type": "image/png"
},
"generator": {
"id": 2001,
"status": "completed",
"type": "image_from_text"
}
}
Terminal window
curl "https://api.gen.pro/v1/content_resources/5012?agent_id=42" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
404content_resource_not_foundResource does not exist or does not belong to this agent.

Renames the file associated with a content resource.

PATCH /v1/content_resources/:id
ParameterTypeRequiredDescription
agent_idintegerYesThe agent that owns the resource.
idintegerYesThe content resource ID (path parameter).
content_resource[filename]stringYesThe new filename for the resource.

Returns 200 OK with an empty body on success.

Terminal window
curl -X PATCH "https://api.gen.pro/v1/content_resources/5012?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"content_resource": {"filename": "hero-banner-v2.png"}}'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to update resources for this agent.
404not_foundResource not found.
422validation_errorInvalid filename or other validation failure.

Permanently deletes a content resource and its associated file.

DELETE /v1/content_resources/:id
ParameterTypeRequiredDescription
agent_idintegerYesThe agent that owns the resource.
idintegerYesThe content resource ID (path parameter).

Returns 200 OK with an empty body on success.

Terminal window
curl -X DELETE "https://api.gen.pro/v1/content_resources/5012?agent_id=42" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to delete resources for this agent.
404not_foundResource not found.
422validation_errorResource could not be deleted.

Returns a paginated, unified view of the agent’s asset library. This combines content resources (files) and asset folders into a single list, with support for filtering by type, folder, and search.

GET /v1/asset_libraries
ParameterTypeRequiredDescription
agent_idintegerYesThe agent whose asset library to list.
folder_idintegerNoShow contents of a specific folder. Omit to show root-level items.
asset_typestringNoComma-separated filter: image, video, audio, folder. Example: image,video.
searchstringNoSearch assets by name.
orderstringNoSort order. Use recent for newest first (default: folders first, then newest).
pageintegerNoPage number (default 1).
page_sizeintegerNoItems per page (default 20).

Items are polymorphic. Content resources include file details; folders include a name.

[
{
"id": 15,
"type": "AssetFolder",
"name": "Brand Assets"
},
{
"id": 5012,
"type": "ContentResource",
"url": "https://cdn.gen.pro/uploads/abc123.png",
"thumbnail_url": "https://cdn.gen.pro/uploads/abc123_thumb.png",
"file_name": "product-hero.png",
"content_type": "image/png"
},
{
"id": 5008,
"type": "ContentResource",
"url": "https://cdn.gen.pro/uploads/def456.mp4",
"thumbnail_url": null,
"file_name": "intro-clip.mp4",
"content_type": "video/mp4"
}
]
Terminal window
# Root-level assets
curl "https://api.gen.pro/v1/asset_libraries?agent_id=42" \
-H "X-API-Key: your-api-key"
# Inside a folder, images only
curl "https://api.gen.pro/v1/asset_libraries?agent_id=42&folder_id=15&asset_type=image" \
-H "X-API-Key: your-api-key"
# Search
curl "https://api.gen.pro/v1/asset_libraries?agent_id=42&search=banner" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
404not_foundAgent or folder not found.

Creates a new folder in the agent’s asset library. Folders can be nested by specifying a parent_id.

POST /v1/asset_folders
ParameterTypeRequiredDescription
agent_idintegerYesThe agent to create the folder under.
asset_folder[name]stringYesName of the folder.
asset_folder[parent_id]integerNoID of the parent folder for nesting. Omit to create at root level.
{
"asset_folder_id": 16
}
Terminal window
# Root-level folder
curl -X POST "https://api.gen.pro/v1/asset_folders?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"asset_folder": {"name": "Campaign Q3"}}'
# Nested folder
curl -X POST "https://api.gen.pro/v1/asset_folders?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"asset_folder": {"name": "Thumbnails", "parent_id": 15}}'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to modify this agent’s assets.
422validation_errorInvalid folder name or parent.

Renames an existing asset folder.

PATCH /v1/asset_folders/:id
ParameterTypeRequiredDescription
agent_idintegerYesThe agent that owns the folder.
idintegerYesThe asset folder ID (path parameter).
asset_folder[name]stringYesThe new folder name.
{
"asset_folder_id": 15
}
Terminal window
curl -X PATCH "https://api.gen.pro/v1/asset_folders/15?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"asset_folder": {"name": "Brand Assets 2026"}}'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to modify this agent’s assets.
404not_foundFolder not found or does not belong to this agent.
422validation_errorInvalid folder name.

Permanently deletes an asset folder and all of its contents (subfolders and files).

DELETE /v1/asset_folders/:id
ParameterTypeRequiredDescription
agent_idintegerYesThe agent that owns the folder.
idintegerYesThe asset folder ID (path parameter).

Returns 200 OK with an empty body on success.

Terminal window
curl -X DELETE "https://api.gen.pro/v1/asset_folders/16?agent_id=42" \
-H "X-API-Key: your-api-key"
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403forbiddenYou do not have permission to delete this agent’s assets.
404not_foundFolder not found or does not belong to this agent.
422folder_removal_failedFolder could not be deleted.

Returns a pre-signed S3 URL for uploading a file directly from the client. This is the recommended approach for large files — the upload goes straight to S3 without passing through the API server.

Workflow:

  1. Call this endpoint with file metadata to get a signed upload URL.
  2. PUT the file bytes to the returned direct_upload.url with the provided headers.
  3. Use the returned signed_id as the content_resource[file] value when creating a content resource.
POST /v1/direct_upload
ParameterTypeRequiredDescription
blob[filename]stringYesOriginal filename including extension.
blob[byte_size]integerYesFile size in bytes. Maximum 1 GB.
blob[checksum]stringYesBase64-encoded MD5 checksum of the file.
blob[content_type]stringYesMIME type (e.g., image/png, video/mp4).
blob[metadata]objectNoArbitrary key-value metadata to attach to the blob.
{
"id": 98765,
"key": "abcdef123456",
"filename": "hero-video.mp4",
"content_type": "video/mp4",
"byte_size": 52428800,
"checksum": "x8F1TrG7p+mAWjK7Yv3QZA==",
"signed_id": "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaH...",
"direct_upload": {
"url": "https://s3.amazonaws.com/gen-uploads/abcdef123456?X-Amz-Signature=...",
"headers": {
"Content-Type": "video/mp4",
"Content-MD5": "x8F1TrG7p+mAWjK7Yv3QZA=="
}
}
}
Terminal window
# Step 1: Get the signed upload URL
curl -X POST https://api.gen.pro/v1/direct_upload \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"blob": {
"filename": "hero-video.mp4",
"byte_size": 52428800,
"checksum": "x8F1TrG7p+mAWjK7Yv3QZA==",
"content_type": "video/mp4"
}
}'
# Step 2: Upload the file directly to S3
curl -X PUT "https://s3.amazonaws.com/gen-uploads/abcdef123456?X-Amz-Signature=..." \
-H "Content-Type: video/mp4" \
-H "Content-MD5: x8F1TrG7p+mAWjK7Yv3QZA==" \
--data-binary @hero-video.mp4
# Step 3: Create the content resource using the signed_id
curl -X POST "https://api.gen.pro/v1/content_resources?agent_id=42" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"content_resource": {"file": "eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaH..."}}'
StatusError codeDescription
401unauthorizedMissing or invalid API key.
422invalid_content_typeThe MIME type is not in the accepted list.
422file_size_exceededFile exceeds the 1 GB maximum.
422direct_upload_failedUnexpected error creating the upload.