Skip to main content
This endpoint requires a valid Bearer token.

List connected platform accounts

GET /api/platform/find
Returns the platform account document associated with the authenticated user. This document contains connection status, profile data, and (server-side only) stored credentials for every supported platform.

Supported platforms

Hayon supports connecting to the following platforms:
PlatformAuth methodRoutes prefix
BlueskyApp password (direct credential exchange)/api/platform/bluesky
TumblrOAuth 1.0a/api/platform/tumblr
Facebook + InstagramOAuth 2.0 (Meta)/api/platform/facebook
ThreadsOAuth 2.0/api/platform/threads
MastodonOAuth 2.0/api/platform/mastodon
See Connecting Platforms for the full connection flow for each platform.

How platform accounts are stored

Each user has a single platform account document that holds sub-documents for each platform. The structure for a connected platform includes:
  • connected — boolean indicating whether the platform is currently linked.
  • profile — cached display name, handle, and avatar URL fetched at connection time.
  • auth — server-side only: access tokens, refresh tokens, and expiry timestamps. These fields are never returned in API responses.
  • platformId or platform-specific identifiers (e.g. did for Bluesky, instanceUrl for Mastodon, blogHostname for Tumblr).
Auth credentials (accessToken, refreshJwt, oauthToken, etc.) are stored server-side and are never included in responses from /api/platform/find or any other endpoint.

Response

success
boolean
required
true on success.
message
string
required
"Platform accounts found"
data
object
required
The platform account document for the user.

Example

curl --request GET \
  --url 'https://api.hayon.app/api/platform/find' \
  --header 'Authorization: Bearer <token>'

Example response

200
{
  "success": true,
  "message": "Platform accounts found",
  "data": {
    "bluesky": {
      "connected": true,
      "did": "did:plc:abcdef1234567890",
      "handle": "yourname.bsky.social",
      "profile": {
        "displayName": "Your Name",
        "description": "Social media enthusiast",
        "avatar": "https://cdn.bsky.app/img/avatar/plain/did:plc:abc.../..."
      }
    },
    "tumblr": {
      "connected": false
    },
    "facebook": {
      "connected": true,
      "platformId": "123456789012345",
      "profile": {
        "displayName": "My Page",
        "handle": "mypage",
        "avatar": "https://example.com/avatar.jpg"
      }
    },
    "threads": {
      "connected": false
    },
    "mastodon": {
      "connected": true,
      "instanceUrl": "https://mastodon.social",
      "accountId": "109876543210",
      "profile": {
        "handle": "yourname",
        "displayName": "Your Name",
        "avatar": "https://mastodon.social/avatars/..."
      }
    }
  }
}

Build docs developers (and LLMs) love