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.

TierRequests/minBurst Limit
Free6010
Pro Creator60050
EnterpriseCustomCustom

Rate limit headers are included in every response:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Users

GET /users/me

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
}
PUT /users/me

Update the authenticated user's public profile.

Request Body

ParameterTypeRequiredDescription
display_namestringRequiredUser's public display name (3-30 chars)
biostringShort biography (max 160 chars)
avatar_urlstringDirect URL to avatar image

Posts

POST /posts

Create a new public post on behalf of the authenticated user.

Request Body

ParameterTypeRequiredDescription
contentstringRequiredPost text content (max 280 chars)
media_urls[]arrayArray of direct media URLs (max 4)
visibilityenumpublic, followers, private

Response

{
  "id": "pst_7f3e9a21",
  "created_at": "2025-01-15T14:32:00Z",
  "status": "published",
  "engagement": {
    "likes": 0,
    "comments": 0,
    "shares": 0
  }
}

Communities

GET /communities/{id}

Retrieve detailed information about a specific community.

Path Parameters

ParameterTypeRequiredDescription
idstringRequiredUnique 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.

CodeMeaning
400Bad Request โ€” Malformed request body or invalid parameters
401Unauthorized โ€” Missing or invalid API key
403Forbidden โ€” Insufficient permissions for this resource
404Not Found โ€” Resource does not exist
429Too Many Requests โ€” Rate limit exceeded
500Internal 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