Send a finished post from your agent.

Give your agent one workspace key. It can find a connected account, upload your media and queue a delivery.

Connect your account

Open your workspace, connect TikTok or Instagram and issue an agent key. Store it in your agent’s secret manager and use it as a Bearer token. Each key can access the accounts and posts in its workspace. Browser approval for TikTok Direct requires the creator’s sign-in.

Set POSTLANE_URL to your Postlane origin and POSTLANE_API_KEY to your workspace key. List your connected accounts with this command.

curl -fsS -H "Authorization: Bearer ${POSTLANE_API_KEY}" "${POSTLANE_URL}/api/accounts"

Send a video to TikTok

Use the account ID for your intended destination. For a remote video, download it on the agent machine before uploading the file to Postlane.

  1. GET /api/accounts lists accounts. Choose the creator’s TikTok account ID.
  2. POST /api/media uploads the raw file with Content-Type and Content-Length headers. Use MP4 video (up to 256 MiB) or JPEG photos (up to 8 MiB each). Save the returned id. For a deck, upload each photo and preserve the order.
  3. POST /api/posts creates the delivery. Supply a unique Idempotency-Key header and reuse it if the same creation request needs a retry.
{
  "account_id": "YOUR_ACCOUNT_ID",
  "media_ids": ["YOUR_MEDIA_ID"],
  "mode": "draft",
  "caption": "Your caption"
}

For a scheduled delivery, include scheduled_at as an ISO 8601 timestamp with a timezone.

Complete the handoff

Read GET /api/posts/{id} for delivery status and any platform error. A TikTok video draft arrives via an inbox notification. Open the Postlane status page on your phone to copy the caption, then tap the notification to finish your post in TikTok.

For a direct TikTok post, set mode to direct and send the creator to /review/{id}. They preview the media, choose the audience and approve publication. Use direct mode for Instagram Reels and photo carousels.

Explore the API reference →