API Reference
Build integrations with ConnectHub. RESTful API, JSON responses, and Bearer token authentication.
Overview
The ConnectHub API allows developers to programmatically interact with user profiles, content streams, community management, and real-time events. All requests must be made over HTTPS. Calls made over plain HTTP will fail.
Base URL: https://api.connecthub.com/v1
Format: All requests and responses use JSON. Set Content-Type: application/json for POST/PUT requests.
Authentication
Authenticate your API requests using Bearer tokens. Generate your token in the ConnectHub Dashboard โ API Keys.
Include your token in the Authorization header:
Authorization: Bearer ch_live_sk_8f7a9c2d4e1b3f5a67890123456789ab
โ ๏ธ Never expose your secret keys in client-side code or public repositories.
Rate Limits
API requests are limited based on your subscription tier. Exceeding limits returns a 429 Too Many Requests status.
| Tier | Requests/min | Burst Limit |
|---|---|---|
| Free | 60 | 10 |
| Pro Creator | 600 | 50 |
| Enterprise | Custom | Custom |
Rate limit headers are included in every response:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Users
Retrieve the authenticated user's profile information.
Response
{
"id": "usr_92a84c1f",
"username": "sarah_design",
"display_name": "Sarah Mitchell",
"avatar_url": "https://cdn.connecthub.com/avatars/usr_92a84c1f.png",
"bio": "UX Designer & Digital Artist",
"followers_count": 8452,
"verified": true
}
Update the authenticated user's public profile.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| display_name | string | Required | User's public display name (3-30 chars) |
| bio | string | Short biography (max 160 chars) | |
| avatar_url | string | Direct URL to avatar image |
Posts
Create a new public post on behalf of the authenticated user.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| content | string | Required | Post text content (max 280 chars) |
| media_urls[] | array | Array of direct media URLs (max 4) | |
| visibility | enum | public, followers, private |
Response
{
"id": "pst_7f3e9a21",
"created_at": "2025-01-15T14:32:00Z",
"status": "published",
"engagement": {
"likes": 0,
"comments": 0,
"shares": 0
}
}
Communities
Retrieve detailed information about a specific community.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Unique community identifier |
Response
{
"id": "com_45b2c9d8",
"name": "Indie Developers",
"slug": "indie-devs",
"member_count": 12450,
"is_public": true,
"rules": ["Be respectful", "No spam", "Share resources"]
}
Error Codes
ConnectHub uses conventional HTTP status codes to indicate success or failure of API requests.
| Code | Meaning |
|---|---|
| 400 | Bad Request โ Malformed request body or invalid parameters |
| 401 | Unauthorized โ Missing or invalid API key |
| 403 | Forbidden โ Insufficient permissions for this resource |
| 404 | Not Found โ Resource does not exist |
| 429 | Too Many Requests โ Rate limit exceeded |
| 500 | Internal Server Error โ Something went wrong on our end |
Webhooks
Subscribe to real-time events by configuring webhooks in your dashboard. ConnectHub will send HTTP POST requests to your endpoint when events occur.
Supported Events: user.follow, post.engagement, community.member_joined, live.started