Overview
This guide is written for autonomous agents (bots, LLMs, automated pipelines) using the ReelMirror API. It answers two questions: what can a bot do without human intervention, and what requires a human to set up first?Autonomous Account Creation
An agent can bootstrap a ReelMirror account entirely on its own — no human required.Step 1: Sign up
Step 2: Confirm email
Supabase sends a confirmation link to the provided email. The agent reads the link from its inbox and follows it. Once confirmed,email_confirmed_at is set on the user.
Step 3: Get an API key
Use the Supabase JWT from the email confirmation callback to exchange for a permanent API key:rm_xxx key for all future calls.
Step 4: Attach a payment method (optional, unlocks $5 bonus)
For ongoing autonomous operation beyond the welcome bonus, the agent attaches a card headlessly using the Stripe SDK:setup_intent.succeeded and the server grants the $5 welcome bonus automatically.
Step 5: Enable auto-reload (optional)
What a Bot Can Do (summary)
One-time human setup required
| Action | Why | How to unblock |
|---|---|---|
| Connect publishing accounts | OAuth browser redirect | Set up once in the dashboard |
| Fund the account | /v1/billing/topup returns a Stripe URL | Top up via the dashboard, or use headless Stripe SDK after setup-intent |
Fully automatable (after setup)
Once the above are done once, a bot can run the complete loop indefinitely:- Create and configure personas
- Add source accounts with automation mode (
sync_only,auto_clone, orauto_publish) - Link publishing targets to personas (
POST /v1/personas/{id}/publishing-targets) - Trigger content sync, poll until complete
- Browse synced source posts
- Generate new content, poll until complete
- Approve and publish (or reject)
- Poll delivery status
- Manage billing (check balance, toggle auto-reload if card on file)
Recommended Scope Set
For the full loop, request these scopes when creating your API key:billing:write if the bot should manage auto-reload settings.
Complete Autonomous Loop
Step 1: Create a persona
Step 2: Add source accounts
Step 2b: Configure publishing targets
Before usingauto_publish, link connected publishing accounts to the persona. Accounts must be connected via OAuth in the dashboard first.
Step 3: Trigger sync and poll
Step 4: Browse source posts and generate
Step 5: Approve and publish
Step 6: Poll delivery status
Error Handling Reference
| Error code | HTTP | Meaning | Bot action |
|---|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid token | Check API key |
FORBIDDEN | 403 | Missing scope | Add missing scope to API key |
INSUFFICIENT_BALANCE | 402 | Not enough credits | Top up balance via dashboard |
NOT_FOUND | 404 | Resource doesn’t exist | Check IDs |
CONFLICT | 409 | Duplicate resource (e.g., source already added) | Skip, already exists |
VALIDATION_ERROR | 400 | Invalid request body | Fix request parameters |
RATE_LIMITED | 429 | Too many requests | Wait for X-RateLimit-Reset, then retry |
UPSTREAM_ERROR | 502 | External service error (platform API) | Retry with exponential backoff |
SERVICE_UNAVAILABLE | 503 | ReelMirror temporarily down | Retry after 60 seconds |
Approve returns 400
IfPOST /v1/generated-posts/{id}/approve returns 400, the most common cause is that the persona has no connected publishing accounts. Use send-to-compose instead, or connect accounts via the dashboard.
Sync returns no new posts
Sources may be rate-limited or have no new content since the last sync. Checksource_posts count and the creator’s last_synced_at field. The 15-minute sync cooldown can be bypassed with force: true in direct backend calls.
Idempotency Considerations
- Source posts: Each source post has a unique
(creator_id, platform, platform_post_id). If you call/generateon the samesource_post_idtwice, the second call creates a new generated post — deduplication is your responsibility. CheckGET /v1/personas/{id}/generated-postsbefore generating. - Sources: Adding the same username/platform twice returns
409 CONFLICT. Catch and skip. - Sync jobs: Triggering sync within 15 minutes of the last sync returns a
skippedjob immediately.
Polling Best Practices
Use exponential backoff for all polling loops:- Sync job: 30 seconds – 5 minutes
- Image generation: 20 – 90 seconds
- Video generation: 60 – 300 seconds
- Publishing delivery: 10 – 60 seconds