API reference
Start connecting a social account; returns the URL your user opens to authorize it.
https://api.betterpost.dev/v1/connect/{platform}See Connect an account for the whole flow. In the sandbox the URL opens a simulated consent page on BetterPost.
| Name | Description |
|---|---|
platform | twitter, linkedin, instagram or facebook. |
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | No | Put the new account in this profile. |
redirectUri | string | No | Absolute http(s) URL to send the user back to. Receives ?connected=<id>&platform=<platform> or ?error=access_denied. |
curl -s "https://api.betterpost.dev/v1/connect/instagram?profileId=prof_1b7r4a9n2d5c8l0e3k6s9m2x&redirectUri=https%3A%2F%2Fapp.example.com%2Fsocial%2Fdone" \
-H "x-access-key: $BETTERPOST_API_KEY"200 OK
{ "url": "https://betterpost.dev/sandbox/authorize?state=Qm3x9TzK2pV8wLr4nB6yHc1dF7gJ0sAeUoXiZtNq" }The link is single-use and expires after 15 minutes.
| Status | Code | When |
|---|---|---|
200 | Success. | |
400 | invalid_platform | Unknown platform. |
400 | validation_error | redirectUri is not an absolute http(s) URL. |
401 | unauthorized | Missing or unknown API key. |
403 | platform_not_available | A platform BetterPost does not support yet, such as tiktok. |
404 | not_found | profileId does not exist in this project. |
429 | rate_limited | More than 120 requests per minute. |