Skip to main content

API Reference

This document provides detailed information about the Upload Post API endpoints.

Authentication

All API requests require authentication using your API key. Include it in the request header:

Authorization: Bearer your-api-key

Base URL

https://api.upload-post.com/v1

Endpoints

TikTok

Upload Video

POST /tiktok/upload

Request Body:

{
"video": "base64_encoded_video",
"caption": "Video caption",
"hashtags": ["#tag1", "#tag2"],
"privacy": "public|private|friends",
"schedule_time": "2024-03-20T15:00:00Z"
}

Response:

{
"id": "upload_123",
"status": "processing",
"platform": "tiktok",
"created_at": "2024-03-19T10:00:00Z"
}

Instagram

Upload Photo

POST /instagram/photo

Request Body:

{
"image": "base64_encoded_image",
"caption": "Photo caption",
"location": "San Francisco, CA",
"hashtags": ["#photography", "#nature"],
"schedule_time": "2024-03-20T15:00:00Z"
}

Response:

{
"id": "upload_456",
"status": "processing",
"platform": "instagram",
"created_at": "2024-03-19T10:00:00Z"
}

Facebook

Upload to Page

POST /facebook/page/{page_id}/post

Request Body:

{
"content": "Post content",
"media": ["base64_encoded_image"],
"link": "https://example.com",
"schedule_time": "2024-03-20T15:00:00Z"
}

Response:

{
"id": "upload_789",
"status": "processing",
"platform": "facebook",
"created_at": "2024-03-19T10:00:00Z"
}

YouTube

Upload Video

POST /youtube/upload

Request Body:

{
"video": "base64_encoded_video",
"title": "Video title",
"description": "Video description",
"privacy": "public|private|unlisted",
"tags": ["tag1", "tag2"],
"schedule_time": "2024-03-20T15:00:00Z"
}

Response:

{
"id": "upload_101",
"status": "processing",
"platform": "youtube",
"created_at": "2024-03-19T10:00:00Z"
}

Common Parameters

Schedule Time

All upload endpoints support scheduling posts using the schedule_time parameter. The time should be provided in ISO 8601 format with UTC timezone.

Privacy Settings

Available privacy options vary by platform:

  • TikTok: public, private, friends
  • Instagram: public, private
  • Facebook: public, friends, only_me
  • YouTube: public, private, unlisted

Error Responses

All endpoints may return the following error responses:

400 Bad Request

{
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request parameters",
"details": {
"field": "video",
"message": "Video file is required"
}
}
}

401 Unauthorized

{
"error": {
"code": "INVALID_CREDENTIALS",
"message": "Invalid API key"
}
}

429 Too Many Requests

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded",
"retry_after": 60
}
}

Rate Limits

  • Free tier: 100 requests per hour
  • Pro tier: 1000 requests per hour
  • Enterprise tier: Custom limits

Webhooks

Events

  • upload.completed: Triggered when an upload is successfully completed
  • upload.failed: Triggered when an upload fails
  • upload.processing: Triggered when an upload starts processing

Webhook Payload

{
"event": "upload.completed",
"data": {
"id": "upload_123",
"platform": "tiktok",
"url": "https://tiktok.com/@user/video/123",
"created_at": "2024-03-19T10:00:00Z"
}
}