{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postproxy-dev/json-schema/postproxy-dev-profile-schema.json",
  "title": "Profile",
  "description": "A connected social media account.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postproxy-dev-openapi.json#/components/schemas/Profile",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique profile identifier (id)."
    },
    "name": {
      "type": "string",
      "description": "Display name of the connected account."
    },
    "username": {
      "type": [
        "string",
        "null"
      ],
      "description": "Handle on the platform (without @). null when the platform does not expose one."
    },
    "platform_id": {
      "type": "string",
      "description": "The account's ID on the platform."
    },
    "status": {
      "type": "string",
      "description": "Platform connection status. inactive might mean disconnected or suspended on a platform, or waiting for a group that can take it - see inactive_reason.",
      "enum": [
        "active",
        "expired",
        "inactive"
      ]
    },
    "inactive_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "network_taken",
        null
      ],
      "description": "Why an inactive profile is inactive. network_taken: the account arrived with a Facebook login that granted several Instagram accounts, but its group already holds an active Instagram profile - move it to a group without one to activate it. null otherwise, including when the connection was lost and needs reconnecting."
    },
    "platform": {
      "type": "string",
      "description": "Platform identifier.",
      "enum": [
        "facebook",
        "instagram",
        "tiktok",
        "linkedin",
        "youtube",
        "twitter",
        "threads",
        "pinterest",
        "bluesky",
        "telegram",
        "google_business"
      ]
    },
    "profile_group_id": {
      "type": "string",
      "description": "ID of the profile group this belongs to."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601 timestamp when the connection expires (if applicable). null when the token does not expire or has a refresh token."
    },
    "post_count": {
      "type": "integer",
      "description": "Number of posts made through this profile."
    },
    "avatar_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Stable Postproxy storage URL of the account's profile picture, resized to 256x256. null until it has been mirrored. For facebook this is the connecting user's picture; each Page's picture is avatar_url on its placement."
    },
    "platform_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public URL of the account on the platform. null when the platform has no stable public profile URL (e.g. linkedin, google_business)."
    },
    "placements_sync_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "syncing",
        "synced",
        "failed",
        null
      ],
      "description": "State of the latest pull of this profile's placements. The pull runs in the background right after connecting and can take several minutes on profiles with many pages/locations. null for platforms without placements and for telegram, whose channels arrive via webhook."
    }
  }
}