Skip to content

Quickstart

This walkthrough takes you from an API key to a published TikTok post. Each step shows both curl and the CLI.

Set your key once for the shell session:

Terminal window
export LOOMTA_API_KEY=loomta_sk_your_key_here
  1. Find the platform you’ll post to. Every post targets one or more platform IDs.

    Terminal window
    curl https://api.loomta.com/public/v1/platforms \
    -H "Authorization: Bearer $LOOMTA_API_KEY"

    Grab the id of the TikTok account from the platforms array.

  2. Check the posting rules. The schema tells you content limits, how many images/videos are allowed, and which settings the account supports.

    Terminal window
    curl https://api.loomta.com/public/v1/platforms/<PLATFORM_ID>/schema \
    -H "Authorization: Bearer $LOOMTA_API_KEY"
  3. Upload your media. TikTok only accepts media that Loomta hosts, so this step is required β€” a local path or arbitrary URL will be rejected. The upload returns a READY object immediately; keep its id.

    Terminal window
    curl https://api.loomta.com/public/v1/media \
    -H "Authorization: Bearer $LOOMTA_API_KEY" \
    -F "file=@./launch.mp4" \
    -F "mimeType=video/mp4"
  4. Create the post. Pass the platform ID and media ID. mode: now publishes immediately.

    Terminal window
    curl https://api.loomta.com/public/v1/posts \
    -H "Authorization: Bearer $LOOMTA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "platformIds": ["<PLATFORM_ID>"],
    "content": "We just shipped πŸš€ #buildinpublic",
    "mode": "now",
    "mediaIds": ["<MEDIA_ID>"],
    "settings": { "privacy_level": "PUBLIC_TO_EVERYONE" }
    }'

    The response contains a per-platform results array:

    {
    "results": [
    {
    "platformId": "<PLATFORM_ID>",
    "status": "created",
    "post": { "root": { "id": "…", "state": "QUEUE" }, "children": [] }
    }
    ]
    }
  5. Confirm. List recent posts (or fetch the group by ID).

    Terminal window
    curl https://api.loomta.com/public/v1/posts \
    -H "Authorization: Bearer $LOOMTA_API_KEY"