ConnectHub API Documentation
Welcome to the ConnectHub REST API. This guide provides everything you need to integrate with our platform programmatically. Build integrations, automate workflows, and extend your social applications with our robust, developer-friendly endpoints.
All requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Authentication
ConnectHub uses API keys to authenticate requests. You can view and manage your API keys in the ConnectHub Developer Dashboard. Your API keys carry many privileges, so be sure to keep them secure. Do not share your API keys in publicly accessible areas such as GitHub, client-side code, etc.
Authenticate your API requests by including the Authorization header with a valid Bearer token:
Authorization: Bearer your_api_key_here
Include this header in every API request. If your API key is invalid or expired, you will receive a 401 Unauthorized response.
Endpoints
Below are the core endpoints available in the ConnectHub API. Each endpoint follows standard REST conventions and returns JSON responses.
Retrieve a specific user's public profile information by their unique identifier.
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Unique identifier of the user |
{
"id": "usr_8f3a9c2d",
"username": "sarah_design",
"display_name": "Sarah Mitchell",
"bio": "Digital artist & UI designer",
"followers_count": 12450,
"verified": true,
"created_at": "2023-04-12T18:30:00Z"
}
Create a new post on behalf of an authenticated user.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Post text content (max 5000 chars) |
media_urls | array | No | List of image/video URLs |
visibility | string | No | public, followers, private |
{
"content": "Just launched my new portfolio! ๐จโจ",
"media_urls": ["https://cdn.connecthub.com/img/123.jpg"],
"visibility": "public"
}
{
"id": "post_9x2m4n7p",
"status": "published",
"created_at": "2025-01-15T10:22:00Z",
"engagement": {
"likes": 0,
"comments": 0,
"shares": 0
}
}
Retrieve paginated feed items based on type. Supports cursor-based pagination.
| Parameter | Type | Required | Description |
|---|---|---|---|
feed_type | string | Yes | home, trending, followers |
limit | integer | No | Items per page (default: 20, max: 50) |
cursor | string | No | Pagination cursor from previous response |
{
"items": [
{
"id": "post_abc123",
"author": { "id": "usr_xyz", "username": "dev_jay" },
"content": "Building in public ๐",
"created_at": "2025-01-14T09:15:00Z"
}
],
"next_cursor": "eyJpZCI6MTIzfQ==",
"has_more": true
}
Error Handling
ConnectHub uses standard HTTP status codes to indicate success or failure. Codes in the 2xx range indicate success, 4xx indicate client errors, and 5xx indicate server errors.
| Code | Meaning | Resolution |
|---|---|---|
400 | Bad Request | Check request body and parameters |
401 | Unauthorized | Verify your API key and authentication header |
403 | Forbidden | You lack permissions for this action |
404 | Not Found | Endpoint or resource does not exist |
429 | Too Many Requests | Rate limit exceeded. Check X-RateLimit-Reset header |
500 | Internal Server Error | ConnectHub issue. Retry after a few seconds |
All error responses follow this JSON structure:
{
"error": {
"code": "invalid_api_key",
"message": "The provided API key is invalid or expired.",
"status": 401,
"request_id": "req_8f3a9c2d"
}
}
Rate Limits
API requests are rate-limited to ensure fair usage and platform stability. Limits vary by subscription tier. Headers in every response indicate your current usage.
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests allowed per window |
X-RateLimit-Remaining | Requests left in current window |
X-RateLimit-Reset | UNIX timestamp when the window resets |
| Plan | Requests/Hour | Burst Limit | Webhook Events |
|---|---|---|---|
| Free | 1,000 | 20/min | 100/day |
| Pro Creator | 10,000 | 100/min | 10,000/day |
| Enterprise | 100,000+ | Custom | Unlimited |
Implement exponential backoff for 429 responses. Never block on rate limits.
Official SDKs & Tools
Accelerate development with our officially maintained client libraries and integrations.
JavaScript / Node.js
npm install @connecthub/sdk
Python
pip install connecthub-py
cURL Examples
curl -X GET https://api.connecthub.com/v1/users/me -H "Authorization: Bearer $TOKEN"