Reference docs

Full API reference for hosted social connection and publishing.

Every public route includes what it does, what to send, and what comes back. Docs use the live base URL `https://mypostshare.com/api` so customer teams can move faster in production.

Documentation surface

Everything needed to integrate

Overview

How customers use the platform

Customer companies create apps in your dashboard, configure provider credentials or managed credentials, and issue API keys. Their backend then uses your public API to create end users, start hosted OAuth flows, inspect connections, publish posts, and schedule future delivery.

Dashboard setup

Apps, keys, redirect allowlists, provider credentials, and operator logs.

Hosted OAuth

Connect users through your flow and redirect back safely with non-secret fields only.

Publishing API

Immediate and scheduled posting backed by request-level and delivery-level statuses.

Quickstart

Setup flow before calling the endpoints

1

Create an app in the dashboard and issue an API key.

2

Choose whether the app uses customer-owned credentials or your managed provider credentials.

3

Register the generated fixed provider callback URL in the provider developer console when using customer-owned credentials.

4

Allowlist every customer redirect URL that should receive the final OAuth callback.

5

Create or upsert an end user with `/v1/end-users`.

6

Create a hosted connect session and send the user to the returned `connectUrl`.

7

Poll connection and post request status from the customer product as needed.

Endpoint Reference

Every public route with examples and response shape

Create or upsert end user

POST/v1/end-users

Creates a tenant-scoped end user or updates the existing record for the same external user ID.

Use this route before creating connect sessions or publishing posts so the platform has a stable customer user mapping.

Authentication

Bearer API key required

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY` for the current customer app.

Request body

externalUserIdstringRequired

Unique user ID from the customer product.

displayNamestringOptional

Human-readable label shown in dashboard inventory.

emailstringOptional

Optional email for operator visibility.

metadataobjectOptional

Free-form customer metadata stored with the end user.

POST/v1/end-users
cURL
curl -X POST "https://mypostshare.com/api/v1/end-users" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "displayName": "Alex Morgan",
    "email": "alex@example.com",
    "metadata": { "plan": "pro", "source": "web-app" }
  }'
200Upserted
JSON
{
  "id": "4ea64e37-6c19-43a0-8ef5-1a7e7e2b0b89",
  "externalUserId": "user_123",
  "displayName": "Alex Morgan",
  "email": "alex@example.com",
  "metadata": { "plan": "pro", "source": "web-app" },
  "createdAt": "2026-03-21T08:00:00.000Z",
  "updatedAt": "2026-03-21T08:00:00.000Z"
}

Get end user

GET/v1/end-users/:externalUserId

Returns the stored end user profile and a high-level connection summary.

Use this route when the customer product needs to know whether a user has already been onboarded in the current app.

Authentication

Bearer API key required

Path parameters

externalUserIdstringRequired

Customer-defined end user identifier.

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

GET/v1/end-users/:externalUserId
cURL
curl -X GET "https://mypostshare.com/api/v1/end-users/user_123" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Retrieved
JSON
{
  "id": "4ea64e37-6c19-43a0-8ef5-1a7e7e2b0b89",
  "externalUserId": "user_123",
  "displayName": "Alex Morgan",
  "email": "alex@example.com",
  "connectionSummary": { "total": 2, "connected": 1, "failed": 0 }
}

List end user connections

GET/v1/end-users/:externalUserId/connections

Lists connected social accounts for the end user, including platform and account metadata.

Use this route to show connection status in the customer app or to confirm a platform is ready before publishing.

Authentication

Bearer API key required

Path parameters

externalUserIdstringRequired

Customer-defined end user identifier.

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

GET/v1/end-users/:externalUserId/connections
cURL
curl -X GET "https://mypostshare.com/api/v1/end-users/user_123/connections" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Retrieved
JSON
[
  {
    "id": "7c7f00f5-3412-4546-8cb7-3f095b16fe49",
    "platform": "linkedin",
    "status": "connected",
    "remoteAccountId": "H8a9UFibz4",
    "remoteUsername": "ALEX_MORGAN",
    "accountType": "person"
  }
]

Disconnect a platform

DELETE/v1/end-users/:externalUserId/connections/:platform

Removes a linked social connection for a specific end user and platform.

Use this when a customer wants to revoke the local platform linkage or force a reconnect for a specific provider.

Authentication

Bearer API key required

Path parameters

externalUserIdstringRequired

Customer-defined end user identifier.

platformstringRequired

Provider key. Supported values: `linkedin`, `facebook`, `instagram`, `twitter`, `youtube`.

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

DELETE/v1/end-users/:externalUserId/connections/:platform
cURL
curl -X DELETE "https://mypostshare.com/api/v1/end-users/user_123/connections/linkedin" \
  -H "Authorization: Bearer YOUR_API_KEY"
204Deleted
JSON
{}

Create connect session

POST/v1/connect-sessions

Creates a hosted OAuth session and returns the `connectUrl` the customer frontend should open.

This is the main entry point for hosted account linking. The platform binds provider callback state to this session and safely redirects back later.

Authentication

Bearer API key required

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

Request body

externalUserIdstringRequired

End user identifier already created for the current app.

platformstringRequired

Provider to connect. Supported values: `linkedin`, `facebook`, `instagram`, `twitter`, `youtube`.

redirectUristringRequired

Customer redirect URL that must already be allowlisted.

displayobjectOptional

Optional metadata used to personalize the hosted connect screen.

POST/v1/connect-sessions
cURL
curl -X POST "https://mypostshare.com/api/v1/connect-sessions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "platform": "linkedin",
    "redirectUri": "https://client.example.com/oauth/callback"
  }'
201Created
JSON
{
  "id": "9469c610-999a-4cb0-9807-a7037947d6b5",
  "status": "pending",
  "platform": "linkedin",
  "connectUrl": "https://mypostshare.com/connect/9469c610-999a-4cb0-9807-a7037947d6b5"
}

Get connect session status

GET/v1/connect-sessions/:id

Returns the latest status for a hosted OAuth session.

Use this route to poll for completion after redirecting the end user to the hosted connect flow.

Authentication

Bearer API key required

Path parameters

idstringRequired

Connect session ID returned from `POST /v1/connect-sessions`.

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

GET/v1/connect-sessions/:id
cURL
curl -X GET "https://mypostshare.com/api/v1/connect-sessions/9469c610-999a-4cb0-9807-a7037947d6b5" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Retrieved
JSON
{
  "id": "9469c610-999a-4cb0-9807-a7037947d6b5",
  "status": "connected",
  "platform": "linkedin",
  "externalUserId": "user_123",
  "errorCode": null,
  "updatedAt": "2026-03-21T06:58:48.753Z"
}

Publish immediately

POST/v1/posts

Creates a direct publish request and attempts delivery right away.

Use this route when the customer app wants an immediate publish action against one or more connected platforms.

Authentication

Bearer API key required

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

Request body

externalUserIdstringRequired

Connected end user to publish on behalf of.

titlestringOptional

Optional title or headline used by supported providers.

contentstringRequired

Main post content.

platformsstring[]Required

List of provider keys to deliver to. Supported values: `linkedin`, `facebook`, `instagram`, `twitter`, `youtube`.

mediaUrlstringOptional

Optional media URL for supported providers.

thumbnailUrlstringOptional

Optional thumbnail asset URL.

metadataobjectOptional

Optional customer metadata attached to the request.

POST/v1/posts
cURL
curl -X POST "https://mypostshare.com/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "title": "Launch update",
    "content": "Testing mypostshare direct posting from docs.",
    "platforms": ["linkedin"],
    "metadata": { "source": "api-docs" }
  }'
201Created
JSON
{
  "id": "e3143cd2-fb9e-42cf-aa45-f7e711d4823d",
  "mode": "immediate",
  "status": "published",
  "externalUserId": "user_123",
  "platformResults": [
    { "platform": "linkedin", "status": "published", "externalId": "urn:li:share:7441018768555757568" }
  ]
}

Schedule a post

POST/v1/posts/scheduled

Creates a scheduled publish request for a future time.

Use this route when the customer app wants the platform worker to execute publishing later.

Authentication

Bearer API key required

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

Request body

externalUserIdstringRequired

Connected end user to schedule a post for.

contentstringRequired

Main post content.

platformsstring[]Required

Providers that should receive the scheduled post. Supported values: `linkedin`, `facebook`, `instagram`, `twitter`, `youtube`.

scheduleAtstringRequired

Future ISO 8601 UTC timestamp when the job should run.

metadataobjectOptional

Optional customer metadata attached to the request.

POST/v1/posts/scheduled
cURL
curl -X POST "https://mypostshare.com/api/v1/posts/scheduled" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "externalUserId": "user_123",
    "content": "Scheduled via mypostshare docs page.",
    "platforms": ["linkedin", "twitter"],
    "scheduleAt": "2026-03-22T09:30:00.000Z",
    "metadata": { "campaign": "launch-week" }
  }'
201Scheduled
JSON
{
  "id": "40bb5e88-4868-4336-af0c-f18dd7a5eb45",
  "mode": "scheduled",
  "status": "scheduled",
  "externalUserId": "user_123",
  "scheduleAt": "2026-03-22T09:30:00.000Z",
  "platformResults": []
}

Get post request

GET/v1/posts/:id

Returns a single publish or schedule request with per-platform delivery results.

Use this route to poll a specific request after creating an immediate or scheduled post.

Authentication

Bearer API key required

Path parameters

idstringRequired

Post request ID returned from a publish or schedule call.

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

GET/v1/posts/:id
cURL
curl -X GET "https://mypostshare.com/api/v1/posts/e3143cd2-fb9e-42cf-aa45-f7e711d4823d" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Retrieved
JSON
{
  "id": "e3143cd2-fb9e-42cf-aa45-f7e711d4823d",
  "mode": "immediate",
  "status": "published",
  "externalUserId": "user_123",
  "platformResults": [
    { "platform": "linkedin", "status": "published", "externalId": "urn:li:share:7441018768555757568" }
  ]
}

List post requests

GET/v1/posts

Returns publish and schedule requests for the current app, optionally filtered by user or status.

Use this route for dashboard views, support tools, and recent activity feeds.

Authentication

Bearer API key required

Headers

AuthorizationstringRequired

Send `Bearer YOUR_API_KEY`.

Query parameters

externalUserIdstringOptional

Optional end user filter.

statusstringOptional

Optional lifecycle filter such as `scheduled` or `published`.

platformstringOptional

Optional provider filter.

dateFromstringOptional

Optional ISO 8601 start date filter.

dateTostringOptional

Optional ISO 8601 end date filter.

GET/v1/posts
cURL
curl -X GET "https://mypostshare.com/api/v1/posts?externalUserId=user_123&status=published" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Retrieved
JSON
[
  { "id": "e3143cd2-fb9e-42cf-aa45-f7e711d4823d", "mode": "immediate", "status": "published", "externalUserId": "user_123" },
  { "id": "40bb5e88-4868-4336-af0c-f18dd7a5eb45", "mode": "scheduled", "status": "scheduled", "externalUserId": "user_123" }
]

Provider Notes

Important implementation guidance

Each platform now uses a fixed callback URL, while connect-session state safely restores the app and redirect destination.

Customer apps can use either their own provider credentials or your managed credentials for faster onboarding.

Redirect URIs must be allowlisted in the dashboard before a connect session can use them.

Hosted OAuth redirects back with safe fields only, never with provider tokens or secrets.

Publishing results return request-level and platform-level status for support and auditing.