API Reference

Complete REST API documentation for automating content creation, scheduling, and analytics across all social media platforms programmatically.

Base URL

https://blackspace.ai/api/v1

All API endpoints are prefixed with this base URL.

Authentication

All API requests must include an authorization header with a valid API key or access token.

Request Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json

Content Generation

Generate Caption

POST
/content/generate/caption

Generate AI-powered captions optimized for specific social platforms.

Request Body

{
  "platform": "instagram",
  "prompt": "Launch day for our new product",
  "tone": "exciting",
  "length": "medium",
  "include_hashtags": true,
  "include_emojis": true,
  "target_audience": "millennials"
}

Response

{
  "caption": "🚀 Launch day is finally here! We're thrilled to unveil our latest innovation...",
  "hashtags": ["#LaunchDay", "#Innovation", "#NewProduct"],
  "character_count": 142,
  "platform_optimized": true
}

Generate Image

POST
/content/generate/image

Create AI-generated images for social media posts.

Request Body

{
  "prompt": "Minimalist product photo on gradient background",
  "style": "professional",
  "dimensions": {
    "width": 1080,
    "height": 1080
  },
  "format": "png"
}

Response

{
  "image_url": "https://cdn.blackspace.ai/images/abc123.png",
  "width": 1080,
  "height": 1080,
  "format": "png",
  "generation_time": 2.4
}

Generate Hashtags

POST
/content/generate/hashtags

Get trending and relevant hashtags for your content.

Request Body

{
  "content": "New sustainable fashion collection launch",
  "platform": "instagram",
  "count": 10,
  "mix": "trending_and_niche"
}

Response

{
  "hashtags": [
    "#SustainableFashion",
    "#EcoFriendly",
    "#SlowFashion",
    "#EthicalStyle"
  ],
  "trending_score": 8.5,
  "estimated_reach": 150000
}

Post Management

Create & Publish Post

POST
/posts/create

Publish content immediately to one or multiple platforms.

Request Body

{
  "platforms": ["instagram", "x", "facebook"],
  "content": {
    "text": "Check out our new product! 🚀",
    "media": [
      {
        "type": "image",
        "url": "https://cdn.example.com/image.jpg"
      }
    ],
    "hashtags": ["#launch", "#innovation"]
  },
  "publish_immediately": true
}

Response

{
  "post_id": "post_abc123",
  "status": "published",
  "published_at": "2025-10-05T14:30:00Z",
  "platforms": {
    "instagram": {
      "post_id": "ig_123",
      "url": "https://instagram.com/p/abc123"
    },
    "x": {
      "post_id": "x_456",
      "url": "https://x.com/user/status/456"
    },
    "facebook": {
      "post_id": "fb_789",
      "url": "https://facebook.com/posts/789"
    }
  }
}

Schedule Post

POST
/posts/schedule

Schedule posts for future publishing with optimal timing.

Request Body

{
  "platforms": ["instagram", "x"],
  "content": {
    "text": "Weekend vibes! 😎",
    "media": [...]
  },
  "schedule_time": "2025-10-06T10:00:00Z",
  "use_optimal_time": false,
  "timezone": "America/New_York"
}

Response

{
  "post_id": "post_def456",
  "status": "scheduled",
  "scheduled_for": "2025-10-06T10:00:00Z",
  "platforms": ["instagram", "x"],
  "can_edit_until": "2025-10-06T09:50:00Z"
}

Get Post Details

GET
/posts/:post_id

Retrieve details and status of a specific post.

Response

{
  "post_id": "post_abc123",
  "status": "published",
  "content": {...},
  "platforms": {...},
  "created_at": "2025-10-05T14:20:00Z",
  "published_at": "2025-10-05T14:30:00Z",
  "metrics": {
    "total_views": 5420,
    "total_likes": 312,
    "total_shares": 45
  }
}

Analytics

Post Analytics

GET
/analytics/posts/:post_id

Get detailed performance metrics for a specific post.

Response

{
  "post_id": "post_abc123",
  "overall_metrics": {
    "views": 15420,
    "likes": 892,
    "comments": 67,
    "shares": 124,
    "engagement_rate": 6.8
  },
  "platform_breakdown": {
    "instagram": {
      "views": 8500,
      "likes": 612,
      "engagement_rate": 7.2
    },
    "x": {
      "views": 4200,
      "likes": 156,
      "engagement_rate": 3.7
    },
    "facebook": {
      "views": 2720,
      "likes": 124,
      "engagement_rate": 4.5
    }
  },
  "best_performing_platform": "instagram",
  "audience_demographics": {
    "age_groups": {...},
    "locations": {...}
  }
}

Account Analytics

GET
/analytics/account

Get overall account performance across all platforms.

Query Parameters

?start_date=2025-09-01&end_date=2025-10-01&platforms=instagram,x

Response

{
  "date_range": {
    "start": "2025-09-01",
    "end": "2025-10-01"
  },
  "summary": {
    "total_posts": 45,
    "total_views": 125000,
    "total_engagement": 8500,
    "average_engagement_rate": 6.8,
    "follower_growth": 1250
  },
  "best_performing_posts": [...]
  "optimal_posting_times": {
    "instagram": "14:00-16:00 EST",
    "x": "09:00-11:00 EST"
  }
}

Error Codes

CodeDescription
200Success - Request completed successfully
400Bad Request - Invalid parameters or malformed request
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Rate Limits

Starter Plan

1,000

requests per month

Pro Plan

50,000

requests per month

Enterprise Plan

Unlimited

requests with custom limits