Skip to content

Publishing

Publishing lets you post content to social media platforms immediately or schedule it for later. Currently supports TikTok, with more platforms coming soon.

Posts or schedules content to a social media platform. Uses the standard user job creation endpoint.

POST /v1/user_jobs?agent_id={agent_id}
ParameterTypeRequiredDescription
agent_idstringYesThe agent ID (query parameter).
user_job_typestringYesMust be publish_content.
datastring (JSON)YesJSON-stringified object containing the post configuration (see Data fields below).

The data value is a JSON string containing:

FieldTypeRequiredDescription
platformstringYesTarget platform. Currently tiktok.
media_urlstringYesPublic URL to the media file (S3 presigned URL, CDN link, etc). Must be accessible at post time.
descriptionstringYesPost caption/description. Max ~2200 characters for TikTok. Include hashtags inline.
titlestringNoPost title (used on some platforms).
media_typestringNoVIDEO (default) or IMAGE.
schedule_typestringYesnow for immediate posting. scheduled for future posting.
scheduled_timestringConditionalISO 8601 UTC datetime (e.g. 2026-03-16T15:00:00Z). Required when schedule_type is scheduled. Must be in the future.
thumbnail_urlstringNoCustom thumbnail URL. Auto-generated from video if not provided.
timezone_offsetintegerNoTimezone offset in minutes from UTC. Default 0.
ValueBehavior
nowPosts immediately via the connected social account.
scheduledQueues for posting at scheduled_time.
{
"user_job_id": 138860
}

Poll status via GET /v1/user_jobs/{id}?agent_id={agent_id}.

StatusDescription
pendingJob created, queued for processing.
processingPost is being submitted to the platform.
completedPost published successfully. The result field contains the post_id from the platform.
failedPublishing failed. Check failed_reason.
Terminal window
curl -X POST "https://api.gen.pro/v1/user_jobs?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"user_job_type": "publish_content",
"data": "{\"platform\": \"tiktok\", \"media_url\": \"https://cdn.example.com/video.mp4\", \"description\": \"Factory price reveal #sourcing #china\", \"schedule_type\": \"now\", \"media_type\": \"VIDEO\"}"
}'
Terminal window
curl -X POST "https://api.gen.pro/v1/user_jobs?agent_id=your-agent-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"user_job_type": "publish_content",
"data": "{\"platform\": \"tiktok\", \"media_url\": \"https://cdn.example.com/video.mp4\", \"description\": \"Your $12 beauty sponge costs 10 cents #beauty #factory\", \"title\": \"Beauty sponge price reveal\", \"schedule_type\": \"scheduled\", \"scheduled_time\": \"2026-03-16T15:00:00Z\", \"media_type\": \"VIDEO\"}"
}'
  • Agent must have a connected TikTok social account (connected via AURA)
  • Video/image must be publicly accessible via URL at post time
  • For scheduled posts, scheduled_time must be in the future
StatusError codeDescription
401unauthorizedMissing or invalid API key.
403permission_deniedYou do not have access to this agent.
422validation_errorInvalid or missing required fields.
422no_active_credit_purchaseThe agent’s workspace has no active credit purchase.