ConnectHub API Documentation
Welcome to the official ConnectHub developer documentation. Build powerful integrations, automate social workflows, and create seamless experiences on our platform.
Overview
The ConnectHub REST API allows you to interact with the platform programmatically. All requests are made over HTTPS and return JSON responses. You can access user profiles, publish content, manage communities, and stream live events directly from your applications.
💡 Tip: Use our official SDKs for faster integration. Available for JavaScript, Python, Go, and Ruby.
Base URL
https://api.connecthub.com/v1
Authentication
All API requests require authentication using Bearer tokens. You can generate tokens via OAuth 2.0 or create API keys from your dashboard. Include your token in the `Authorization` header:
# Replace YOUR_ACCESS_TOKEN with your actual token
curl -X GET https://api.connecthub.com/v1/users/me \\
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
-H "Content-Type: application/json"
⚠️ Security: Never expose your API keys or access tokens in client-side code. Use environment variables or secure backend proxies.
Rate Limits
ConnectHub uses a sliding window rate limiting strategy. Limits vary by plan and endpoint type. Standard requests return `X-RateLimit-Remaining` headers.
- Free Tier: 100 requests/minute
- Pro Creator: 1,000 requests/minute
- Enterprise: 5,000 requests/minute
- Write endpoints: Capped at 50% of your base limit
When you exceed limits, the API returns 429 Too Many Requests. Implement exponential backoff for retries.
Error Handling
ConnectHub uses standard HTTP status codes. Errors are returned as JSON with a consistent structure:
{
"error": {
"code": "VALIDATION_ERROR",
"status": 400,
"message": "Field 'title' is required and must be under 100 characters.",
"details": [
{ "field": "title", "reason": "missing_required" }
]
}
}
Core Endpoints: Posts
Manage content creation, retrieval, and engagement. Supports text, images, videos, and AR effects.
Create Post Example
const res = await fetch(`https://api.connecthub.com/v1/posts`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
content: '🌍 Exploring Tokyo with ConnectHub AR filters!',
media_url: 'https://cdn.connecthub.com/uploads/img_8821.jpg',
tags: ['travel', 'photography'],
visibility: 'public'
})
});
const data = await res.json();
console.log(data.post_id); // "pst_9Xk2mQzLw"
Pagination
All list endpoints support cursor-based pagination. Use the `next_cursor` from the response to fetch subsequent pages:
{
"data": [ ... ],
"meta": {
"total_count": 1248,
"next_cursor": "eyJpZCI6MTIzfQ==",
"has_more": true
}
}