{"openapi":"3.1.0","info":{"title":"Taisly API Documentation","version":"1.0.0","description":"# Taisly API Documentation\n\nThe Taisly API allows you to automate video posting and reposting to multiple social media platforms using simple API key authentication.\n\n## Features\n- Upload and post videos to multiple platforms simultaneously\n- Set up automated reposting from one platform to others\n- Schedule posts for later\n- Manage connected social media accounts\n- Track post history and status\n\n## Requirements\n- **Plan**: FREE, STARTER, INFLUENCER, or PRO (FREE includes API access with free-plan product limits; paid plans unlock more posts and connected accounts)\n- **API Key**: Generate from your dashboard at https://app.taisly.com/settings \n- **HTTPS**: All API requests must use HTTPS\n\n## Rate Limits\n| Plan | Requests per minute |\n|------|------|\n| All plans | 60 |\n\nWhen you exceed the rate limit, you'll receive a 429 error with a `retryAfter` field indicating how many seconds to wait.\n\n## Security Best Practices\n1. Never commit API keys to version control\n2. Store keys in environment variables\n3. Regenerate immediately if compromised\n4. Use HTTPS only\n\n## Video Requirements\n- **Format**: MP4, MOV, or other common video formats\n- **Size**: Maximum 500MB\n- **Duration**: 3-90 seconds\n- **Orientation**: 9:16\n\n## Quick Start Example\n\n```bash\n# 1. Get your connected platforms\ncurl -X GET https://app.taisly.com/api/private/platform/platforms \\\n  -H \"Authorization: Bearer taisly_your_api_key_here\"\n\n# 2. Upload a video\ncurl -X POST https://app.taisly.com/api/private/post \\\n  -H \"Authorization: Bearer taisly_your_api_key_here\" \\\n  -F \"video=@/path/to/video.mp4\" \\\n  -F \"platforms=[\\\"platform_id_1\\\"]\" \\\n  -F \"description=Check out my new video!\"\n\n# 3. Check post history\ncurl -X GET https://app.taisly.com/api/private/post/history \\\n  -H \"Authorization: Bearer taisly_your_api_key_here\"\n```\n\n## Python Example\n\n```python\nimport requests\n\nAPI_KEY = 'taisly_your_api_key_here'\nBASE_URL = 'https://app.taisly.com/api/private'\n\nheaders = {\n    'Authorization': f'Bearer {API_KEY}'\n}\n\n# Get platforms\nresponse = requests.get(f'{BASE_URL}/platform/platforms', headers=headers)\nplatforms = response.json()['data']\nprint(f\"Connected platforms: {len(platforms)}\")\n\n# Upload video\nfiles = {'video': open('video.mp4', 'rb')}\ndata = {\n    'platforms': str([platforms[0]['_id']]),\n    'description': 'My video description'\n}\n\nresponse = requests.post(f'{BASE_URL}/post', headers=headers, files=files, data=data)\nprint(response.json())\n```\n","contact":{"email":"support@taisly.com"}},"servers":[{"url":"https://app.taisly.com/api/private","description":"Production server"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key"}}},"paths":{"/user/api-key":{"get":{"operationId":"getApiKey","tags":["API Key Management"],"security":[{"BearerAuth":[]}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"data":{"keyPrefix":"taisly_a1b2c3","isActive":true,"lastUsedAt":"2026-02-19T10:00:00.000Z","createdAt":"2026-01-01T00:00:00.000Z"}}}}},"403":{"content":{"application/json":{"example":{"success":false}}},"description":"Forbidden"},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Get API Key Information","description":"Retrieve information about your current API key."}},"/user/api-key/generate":{"post":{"operationId":"generateApiKey","tags":["API Key Management"],"security":[{"BearerAuth":[]}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"data":"taisly_a1b2c3d4e5f6..."}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Generate API Key","description":"Generate a new API key or regenerate if one already exists.\n\n**IMPORTANT**:\n- The full API key is only shown once. Save it securely.\n- If you regenerate, the old key will be invalidated immediately."}},"/user/api-key/revoke":{"post":{"operationId":"revokeApiKey","tags":["API Key Management"],"security":[{"BearerAuth":[]}],"responses":{"200":{"content":{"application/json":{"example":{"success":true}}}},"403":{"content":{"application/json":{"example":{"success":false}}},"description":"Forbidden"},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Revoke API Key","description":"Immediately revoke your current API key. All requests using this key will fail."}},"/platform/platforms":{"get":{"operationId":"getPlatforms","tags":["Platforms"],"security":[{"BearerAuth":[]}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"data":[{"id":"507f1f77bcf86cd799439011","platform":"TikTok","displayName":"My TikTok","username":"myusername","usernameImage":"profile.jpg","status":"CONNECTED"}]}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"403":{"content":{"application/json":{"example":{"success":false}}},"description":"Forbidden"},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Get Connected Platforms","description":"Retrieve all social media accounts connected to your account."}},"/post":{"post":{"operationId":"createPost","tags":["Posts"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["video","platforms"],"properties":{"video":{"type":"string","format":"binary","description":" "},"platforms":{"type":"array","items":{"type":"string"},"description":"List of IDs"},"description":{"type":"string"},"previewTime":{"type":"number","description":"Timestamp in seconds for thumbnail generation (default: 0)"},"scheduled":{"type":"string"}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"success":true,"historyId":"64f000000000000000000001","scheduled":false,"date":"2026-06-10T10:00:00.000Z","result":[{"platformId":"64f000000000000000000002","status":"PENDING"}]}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"403":{"content":{"application/json":{"example":{"success":false}}},"description":"Forbidden"},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Create a Post","description":"Upload a video to one or more connected platforms.\n\n**Video Requirements:**\n- Format: MP4, MOV, or other common video formats\n- Size: Maximum 500MB\n- Duration: 3-90 seconds\n- Orientation: Vertical (9:16)\n\n**Scheduling:**\n- Pass `scheduled` as a Unix timestamp in milliseconds for scheduled posting (omit this parameter if you don't want to schedule)"}},"/post/history":{"get":{"operationId":"getPostHistory","tags":["Posts"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"startTime","in":"query","schema":{"type":"integer"}},{"name":"endTime","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"data":[{"id":"507f1f77bcf86cd799439011","description":"My video post","filename":"screenshot.jpg","result":[{"platform":"TikTok","usernameImage":"profile.jpg","id":"507f1f77bcf86cd799439012","username":"myusername","status":"SUCCESS"}],"scheduled":false,"date":"2026-02-19T10:00:00.000Z"}],"total":1}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Get Post History","description":"Retrieve your posting history with status information for each platform.\n\n**Pagination**:\n- Use `page` parameter for pagination (10 items per page)\n- Or use `startTime` and `endTime` for date range filtering (returns all matching posts)\n\n**Status Values**:\n- PENDING: Post is queued\n- SUCCESS: Posted successfully\n- FAILED: Post failed (check message field for error code)"}},"/post/cancelSchedule":{"get":{"operationId":"cancelScheduledPost","tags":["Posts"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"success":true}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Cancel Scheduled Post","description":"Cancel a post that was scheduled for later. The post will be permanently deleted."}},"/reposts":{"get":{"operationId":"getReposts","tags":["Reposts"],"security":[{"BearerAuth":[]}],"responses":{"200":{"content":{"application/json":{"example":{"success":true,"data":[{"id":"507f1f77bcf86cd799439011","from":{"platform":"TikTok","usernameImage":"profile.jpg","username":"sourceuser","status":"CONNECTED","displayName":"Source User"},"to":[{"platform":"Instagram","usernameImage":"profile.jpg","username":"destuser","status":"CONNECTED","displayName":"Dest User"}],"date":"2026-02-19T10:00:00.000Z","isPaused":false}]}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Get Repost Configurations","description":"Retrieve all configured automatic reposting rules. When you post to a 'from' platform, the content will be automatically reposted to all 'to' platforms."}},"/repost/add":{"post":{"operationId":"addRepost","tags":["Reposts"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"Platform ID"},"to":{"type":"array","items":{"type":"string"},"description":"List of platforms IDs"}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"success":true}}}},"400":{"content":{"application/json":{"example":{"success":false,"message":"Circular dependency"}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Add Repost Configuration","description":"Configure automatic reposting from one platform to others.\n\n**How it works**:\n- When you post content to the 'from' platform, it will automatically be reposted to all 'to' platforms\n\n**Note**: Circular dependencies are prevented. You cannot create A→B if B→A already exists."}},"/repost/delete":{"post":{"operationId":"deleteRepost","tags":["Reposts"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"success":true}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Delete Repost Configuration","description":"Remove an automatic reposting rule. Future posts to the source platform will no longer be automatically reposted."}},"/repost/pause":{"post":{"operationId":"pauseRepost","tags":["Reposts"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","pause"],"properties":{"id":{"type":"string"},"pause":{"type":"boolean"},"isPaused":{"type":"boolean"}}}}}},"responses":{"200":{"content":{"application/json":{"example":{"success":true}}}},"401":{"content":{"application/json":{"example":{"success":false}}}},"500":{"content":{"application/json":{"example":{"success":false}}},"description":"Server error"}},"summary":"Pause/Resume Repost Configuration","description":"Temporarily pause or resume automatic reposting. Useful when you want to stop reposting temporarily without deleting the configuration."}}},"tags":[{"name":"API Key Management","description":"Generate, view, and revoke API keys for authentication. API keys are available on every plan. Usage limits depend on the plan.","x-displayName":"API Key Management"},{"name":"Platforms","description":"View connected social media accounts.","x-displayName":"Platforms"},{"name":"Posts","description":"Upload videos and post to multiple platforms simultaneously. Schedule posts for later or post immediately.","x-displayName":"Posts"},{"name":"Reposts","description":"Configure automatic reposting rules to share content from one platform to others automatically.","x-displayName":"Reposts"}]}