{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fopost-com/json-schema/fopost-com-home-overview-response-schema.json",
  "title": "HomeOverviewResponse",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fopost-com-openapi.json#/components/schemas/HomeOverviewResponse",
  "type": "object",
  "properties": {
    "onboarding": {
      "type": "object",
      "properties": {
        "intro_dismissed": {
          "type": "boolean",
          "description": "First Steps was dismissed, or all of its steps were done"
        },
        "has_account": {
          "type": "boolean"
        },
        "has_post": {
          "type": "boolean"
        },
        "has_team": {
          "type": "boolean",
          "description": "Another member is in a workspace, or an invitation was sent"
        },
        "has_api_key": {
          "type": "boolean",
          "description": "An API key is bound to the workspace, or is the caller’s own unbound key"
        }
      },
      "required": [
        "intro_dismissed",
        "has_account",
        "has_post",
        "has_team",
        "has_api_key"
      ]
    },
    "period": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "start": {
              "type": "string",
              "format": "date-time"
            },
            "end": {
              "type": "string",
              "format": "date-time"
            }
          },
          "required": [
            "start",
            "end"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "The seven days the pulse covers; null before the first snapshot"
    },
    "streak": {
      "type": "object",
      "properties": {
        "weeks": {
          "type": "integer",
          "description": "Consecutive weeks with at least one published post"
        }
      },
      "required": [
        "weeks"
      ]
    },
    "goals": {
      "type": "object",
      "properties": {
        "met": {
          "type": "integer"
        },
        "total": {
          "type": "integer",
          "description": "Accounts with a weekly posting goal"
        },
        "percent": {
          "type": "integer",
          "description": "Share of goals met this week, 0 to 100"
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HomeGoalAccount"
          }
        }
      },
      "required": [
        "met",
        "total",
        "percent",
        "accounts"
      ]
    },
    "comment_score": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "value": {
              "type": "integer",
              "description": "0 to 100, the mean of the three parts"
            },
            "response_rate": {
              "type": "integer",
              "description": "Share of comments and mentions answered, last 7 days"
            },
            "response_speed": {
              "type": "integer",
              "description": "Median time to first reply mapped to 0 to 100: under 1 h is 100, over 48 h is 0"
            },
            "consistency": {
              "type": "integer",
              "description": "Share of the last 7 days with a reply when something arrived"
            },
            "trend": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "up",
                "down",
                "same",
                null
              ]
            }
          },
          "required": [
            "value",
            "response_rate",
            "response_speed",
            "consistency",
            "trend"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Null when nothing arrived to answer in the last 7 days"
    },
    "pulse": {
      "type": "object",
      "properties": {
        "posts": {
          "$ref": "#/$defs/HomeOverviewMetric"
        },
        "followers": {
          "$ref": "#/$defs/HomeOverviewMetric"
        },
        "comments": {
          "$ref": "#/$defs/HomeOverviewMetric"
        }
      },
      "required": [
        "posts",
        "followers",
        "comments"
      ]
    },
    "up_next": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Post"
      },
      "description": "The next five scheduled posts, soonest first"
    },
    "comments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "comment",
              "mention",
              "dm"
            ]
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "author_avatar_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "text": {
            "type": "string"
          },
          "platform_created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "conversation_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "A DM's thread key. Null on comments and mentions"
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "username": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "avatar": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "description": "The five most recent unanswered inbox items"
    },
    "unanswered_total": {
      "type": "integer"
    },
    "blog": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "cover_image": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string",
            "description": "The post on the marketing site"
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "cover_image",
          "published_at",
          "url"
        ]
      }
    },
    "blocks": {
      "type": "object",
      "properties": {
        "post_metrics": {
          "$ref": "#/$defs/HomeBlockStatus"
        },
        "channel_metrics": {
          "$ref": "#/$defs/HomeBlockStatus"
        },
        "comments": {
          "$ref": "#/$defs/HomeBlockStatus"
        },
        "blog": {
          "$ref": "#/$defs/HomeBlockStatus"
        }
      },
      "required": [
        "post_metrics",
        "channel_metrics",
        "comments",
        "blog"
      ]
    }
  },
  "required": [
    "onboarding",
    "period",
    "streak",
    "goals",
    "comment_score",
    "pulse",
    "up_next",
    "comments",
    "unanswered_total",
    "blog",
    "blocks"
  ],
  "$defs": {
    "DeliveryMetrics": {
      "type": "object",
      "properties": {
        "impressions": {
          "type": [
            "integer",
            "null"
          ]
        },
        "reach": {
          "type": [
            "integer",
            "null"
          ]
        },
        "engagements": {
          "type": [
            "integer",
            "null"
          ]
        },
        "likes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "comments": {
          "type": [
            "integer",
            "null"
          ]
        },
        "shares": {
          "type": [
            "integer",
            "null"
          ]
        },
        "engagement_rate": {
          "type": [
            "number",
            "null"
          ],
          "description": "Engagements over reach, or over impressions when reach is unknown"
        },
        "permalink": {
          "type": [
            "string",
            "null"
          ]
        },
        "fetched_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "fetched_at"
      ]
    },
    "HomeBlockStatus": {
      "type": "object",
      "properties": {
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the block was last computed; null until the first run"
        },
        "interval": {
          "type": "string",
          "description": "How often the block is recomputed, e.g. \"24 h\""
        }
      },
      "required": [
        "updated_at",
        "interval"
      ]
    },
    "HomeGoalAccount": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "platform": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "avatar": {
          "type": [
            "string",
            "null"
          ]
        },
        "goal": {
          "type": "integer",
          "description": "Posts per week the account aims for"
        },
        "posts": {
          "type": "integer",
          "description": "Posts published from it since Monday (UTC)"
        }
      },
      "required": [
        "id",
        "platform",
        "username",
        "name",
        "avatar",
        "goal",
        "posts"
      ]
    },
    "HomeOverviewMetric": {
      "type": "object",
      "properties": {
        "value": {
          "type": "integer"
        },
        "delta": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Change against the previous seven days, as a count; null without a baseline"
        }
      },
      "required": [
        "value",
        "delta"
      ]
    },
    "MediaItem": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "gif"
          ]
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "size": {
          "type": "number",
          "description": "File size in bytes"
        },
        "alt": {
          "type": "string"
        },
        "thumbnail": {
          "type": "string",
          "format": "uri"
        },
        "media_id": {
          "type": "string",
          "format": "uuid",
          "description": "Library id, when the file is stored in the workspace media library"
        },
        "preview_url": {
          "type": "string",
          "format": "uri",
          "description": "A link that renders the stored file; present for files held in FoPost storage"
        }
      },
      "required": [
        "type",
        "name",
        "url"
      ]
    },
    "Post": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "scheduled",
            "publishing",
            "published",
            "partially_failed",
            "failed",
            "cancelled",
            "unpublished"
          ]
        },
        "content_type": {
          "type": "string",
          "enum": [
            "post",
            "thread",
            "reel"
          ]
        },
        "artifact_type": {
          "type": "string",
          "description": "What the post is, e.g. `text_post`"
        },
        "schedule_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "schedule_mode": {
          "type": "string",
          "enum": [
            "manual",
            "queue"
          ],
          "description": "`queue` when the time was assigned from a posting slot"
        },
        "repeatable": {
          "type": "boolean"
        },
        "repeatable_times": {
          "type": [
            "integer",
            "null"
          ]
        },
        "repeatable_gap": {
          "type": [
            "integer",
            "null"
          ]
        },
        "repeatable_gap_unit": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "hours",
            "days",
            "weeks",
            "months",
            null
          ]
        },
        "remaining_posts": {
          "type": [
            "integer",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "internal_title": {
          "type": [
            "string",
            "null"
          ],
          "description": "Internal name, never published"
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        },
        "origin": {
          "type": "string",
          "enum": [
            "user",
            "agent",
            "automation"
          ],
          "description": "Who created the post"
        },
        "auto_plug": {
          "type": "boolean"
        },
        "auto_plug_content": {
          "type": [
            "string",
            "null"
          ]
        },
        "approved_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejection_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostContentBlock"
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostAccountResult"
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostLabelRef"
          }
        },
        "campaign": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "companion_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Id of the post this one accompanies"
        },
        "settings": {
          "type": "object",
          "description": "Per-account platform settings, keyed by account id",
          "additionalProperties": {
            "type": "object"
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "remote_edits": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RemoteEdit"
          },
          "description": "Present only on an update to a published post: what each network answered"
        }
      },
      "required": [
        "id",
        "workspace_id",
        "status",
        "content_type",
        "content",
        "accounts",
        "labels"
      ]
    },
    "PostAccountResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Social account id"
        },
        "platform": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "avatar": {
          "type": [
            "string",
            "null"
          ]
        },
        "publish_status": {
          "type": "string",
          "enum": [
            "pending",
            "queued",
            "delayed",
            "publishing",
            "published",
            "failed",
            "cancelled",
            "unpublished"
          ]
        },
        "posted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "platform_post_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "external_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "remote_delete": {
          "type": "boolean",
          "description": "True when unpublishing, or deleting with `remove_from_platform`, can take this published post down on the network"
        },
        "remote_edit": {
          "type": "boolean",
          "description": "True when updating the post also changes this published post in place on the network"
        },
        "error_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "error_message": {
          "type": [
            "string",
            "null"
          ],
          "description": "User-friendly error message"
        },
        "raw_error_message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw error message from the platform"
        },
        "attempts": {
          "type": "integer"
        },
        "max_attempts": {
          "type": "integer"
        },
        "scheduled_publish_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "delay_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "delay_message": {
          "type": [
            "string",
            "null"
          ]
        },
        "metrics": {
          "oneOf": [
            {
              "$ref": "#/$defs/DeliveryMetrics"
            },
            {
              "type": "null"
            }
          ],
          "description": "Only with `include=metrics` on the list; null until a reading is stored"
        }
      }
    },
    "PostContentBlock": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "text": {
          "type": [
            "string",
            "null"
          ]
        },
        "media": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MediaItem"
          }
        },
        "position": {
          "type": "integer"
        }
      }
    },
    "PostLabelRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        }
      }
    },
    "RemoteEdit": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "string",
          "format": "uuid",
          "description": "Social account id"
        },
        "platform": {
          "type": "string"
        },
        "edited": {
          "type": "boolean",
          "description": "False when the network refused the change"
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "account_id",
        "platform",
        "edited",
        "error"
      ]
    }
  }
}