{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bamf-ai/json-schema/bamf-ai-post-response-schema.json",
  "title": "PostResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bamf-ai-posts-api-openapi.yml#/components/schemas/PostResponse",
  "type": "object",
  "properties": {
    "data": {
      "oneOf": [
        {
          "$ref": "#/$defs/Post"
        },
        {
          "$ref": "#/$defs/PostPreview"
        },
        {
          "$ref": "#/$defs/JSONValue"
        }
      ]
    }
  },
  "$defs": {
    "BamfPostType": {
      "type": "string",
      "enum": [
        "text",
        "image",
        "carousel",
        "video",
        "article",
        "poll"
      ]
    },
    "JSONValue": {
      "description": "Any JSON value returned by flexible workflow, analytics, context, or generation payloads."
    },
    "Post": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "author_id": {
          "type": "string"
        },
        "creator_id": {
          "type": "string",
          "description": "Alias used by preview responses; raw post rows may use author_id."
        },
        "status_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "post_type": {
          "$ref": "#/$defs/BamfPostType"
        },
        "platform": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "linkedin",
            "x",
            "twitter",
            null
          ]
        },
        "content": {
          "type": "string"
        },
        "topic": {
          "type": [
            "string",
            "null"
          ]
        },
        "first_comment": {
          "type": [
            "string",
            "null"
          ]
        },
        "scheduled_for": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "generated_image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "uploaded_image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "document_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "video_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "PostFirstComment": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "content": {
          "type": "string"
        }
      }
    },
    "PostPreview": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "creator_id": {
          "type": "string"
        },
        "status_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "post_type": {
          "$ref": "#/$defs/BamfPostType"
        },
        "content": {
          "type": "string"
        },
        "topic": {
          "type": [
            "string",
            "null"
          ]
        },
        "first_comment": {
          "$ref": "#/$defs/PostFirstComment"
        },
        "scheduled_for": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "media": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostPreviewMedia"
          }
        },
        "raw": {
          "$ref": "#/$defs/Post"
        }
      }
    },
    "PostPreviewMedia": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "image",
            "carousel_slide",
            "video"
          ]
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "order": {
          "type": "integer"
        },
        "alt_text": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}