Contents API
The Contents API provides endpoints to create, schedule, upload media, inspect, and cancel social media publishing jobs.
📌 Endpoints
Section titled “📌 Endpoints”| Method | Path | Description | Required Scope |
|---|---|---|---|
POST | /v1/brand/contents/uploads | Generate presigned PUT URL for image and video uploads | publishing:create or * |
POST | /v1/brand/contents | Submit immediate or scheduled post (202 Accepted) | publishing:create or * |
GET | /v1/brand/contents | List brand contents with pagination and status filters | publishing:read or * |
GET | /v1/brand/contents/{content_id} | Retrieve content details and publish job outcome | publishing:read or * |
DELETE | /v1/brand/contents/{content_id}/cancel | Cancel a scheduled post before processing begins | publishing:delete or * |
1. Media Upload Presigned URL (POST /v1/brand/contents/uploads)
Section titled “1. Media Upload Presigned URL (POST /v1/brand/contents/uploads)”To attach media to posts, request a presigned upload URL and upload the binary directly to S3/R2 storage via HTTP PUT.
Supported Media Formats
Section titled “Supported Media Formats”- Images (Max 20MB, URL expiry 300s):
image/jpeg,image/png,image/webp,image/gif - Videos (Max 500MB, URL expiry 600s):
video/mp4,video/quicktime(.mov),video/webm
Request Example
Section titled “Request Example”curl -X POST "https://api.ankk.app/v1/brand/contents/uploads" \ -H "Authorization: Bearer spk_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "filename": "launch-banner.png", "content_type": "image/png", "size": 1420500 }'Response Example (200 OK)
Section titled “Response Example (200 OK)”{ "upload_url": "https://storage.ankk.app/sns-posts/original/brand_.../launch-banner.png?X-Amz-Signature=...", "asset_ref": "https://cdn.ankk.app/sns-posts/original/brand_.../launch-banner.png", "method": "PUT", "object_key": "sns-posts/original/brand_.../launch-banner.png", "content_type": "image/png", "size": 1420500, "expires_in_seconds": 300}Upload Binary via PUT
Section titled “Upload Binary via PUT”curl -X PUT "<upload_url>" \ -H "Content-Type: image/png" \ --data-binary "@/path/to/launch-banner.png"2. Publish Content (POST /v1/brand/contents)
Section titled “2. Publish Content (POST /v1/brand/contents)”Submit text along with the uploaded asset_ref to create a publishing job.
Request Body Fields
Section titled “Request Body Fields”| Field | Type | Required | Description |
|---|---|---|---|
connection_id | string | Required | Target SNS connection ID (Connections API) |
idempotency_key | string | Required | Unique client-generated key preventing duplicate submissions |
text | string | Optional | Post body text |
media | array | Optional | Array of media objects with url or asset_ref |
scheduled_for | string | Optional | ISO 8601 timestamp for scheduling. Omit for immediate publish |
thread_posts | array | Optional | Additional posts for Threads conversation chaining |
provider_settings | object | Optional | Platform-specific settings (e.g., YouTube category) |
Request Example (Immediate Post)
Section titled “Request Example (Immediate Post)”curl -X POST "https://api.ankk.app/v1/brand/contents" \ -H "Authorization: Bearer spk_live_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "connection_id": "conn_01jm8x9k2example", "idempotency_key": "launch-2026-001", "text": "Excited to launch our new product today! 🚀\nhttps://ankk.app", "media": [ { "url": "https://cdn.ankk.app/sns-posts/original/brand_.../launch-banner.png" } ] }'Response Example (202 Accepted)
Section titled “Response Example (202 Accepted)”{ "content_id": "content_01jm8za2example", "status": "scheduled", "publish_job_id": "job_01jm8za2jobexample", "connection_id": "conn_01jm8x9k2example", "idempotency_key": "launch-2026-001"}3. List and Inspect Content
Section titled “3. List and Inspect Content”List Content (GET /v1/brand/contents)
Section titled “List Content (GET /v1/brand/contents)”curl -X GET "https://api.ankk.app/v1/brand/contents?status=published&limit=20" \ -H "Authorization: Bearer spk_live_xxxxxxxx"Get Content Details (GET /v1/brand/contents/{content_id})
Section titled “Get Content Details (GET /v1/brand/contents/{content_id})”curl -X GET "https://api.ankk.app/v1/brand/contents/content_01jm8za2example" \ -H "Authorization: Bearer spk_live_xxxxxxxx"4. Cancel Scheduled Post (DELETE /v1/brand/contents/{content_id}/cancel)
Section titled “4. Cancel Scheduled Post (DELETE /v1/brand/contents/{content_id}/cancel)”Cancel a scheduled post before its execution begins.
curl -X DELETE "https://api.ankk.app/v1/brand/contents/content_01jm8za2example/cancel" \ -H "Authorization: Bearer spk_live_xxxxxxxx"