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:
export LOOMTA_API_KEY=loomta_sk_your_key_here-
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"Terminal window loomta platforms:listGrab the
idof the TikTok account from theplatformsarray. -
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"Terminal window loomta platforms:schema <PLATFORM_ID> -
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
READYobject immediately; keep itsid.Terminal window curl https://api.loomta.com/public/v1/media \-H "Authorization: Bearer $LOOMTA_API_KEY" \-F "file=@./launch.mp4" \-F "mimeType=video/mp4"Terminal window loomta upload ./launch.mp4 -
Create the post. Pass the platform ID and media ID.
mode: nowpublishes 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" }}'Terminal window loomta posts:create \-c "We just shipped π #buildinpublic" \-i "<PLATFORM_ID>" \-m "<MEDIA_ID>" \--mode now \--settings '{"privacy_level":"PUBLIC_TO_EVERYONE"}'The response contains a per-platform
resultsarray:{"results": [{"platformId": "<PLATFORM_ID>","status": "created","post": { "root": { "id": "β¦", "state": "QUEUE" }, "children": [] }}]} -
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"Terminal window loomta posts:list
Where to go next
Section titled βWhere to go nextβ- Build a photo carousel with AI captions β see CLI recipes.
- Wire Loomta into an agent β see Use with AI agents.
- Understand failures β see Errors.