{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/everpop-app/json-schema/everpop-app-post-list-envelope-schema.json",
  "title": "PostListEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/everpop-app-posts-api-openapi.yml#/components/schemas/PostListEnvelope",
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PostItem"
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass back as ?cursor= for the next (older) page; null on the last page."
    }
  },
  "required": [
    "ok",
    "data",
    "nextCursor"
  ],
  "$defs": {
    "PostItem": {
      "type": "object",
      "properties": {
        "postId": {
          "type": "string"
        },
        "clipId": {
          "type": "string"
        },
        "destinationId": {
          "type": "string"
        },
        "destinationName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The connected account's display name."
        },
        "platform": {
          "type": "string",
          "enum": [
            "TIKTOK",
            "INSTAGRAM_REELS",
            "YOUTUBE_SHORTS",
            "FACEBOOK_REELS",
            "THREADS"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "PENDING",
            "QUEUED",
            "PUBLISHING",
            "PUBLISHED",
            "DELIVERED",
            "FAILED",
            "SCHEDULED",
            "DISMISSED",
            "DEFERRED"
          ],
          "description": "DELIVERED = in the creator's TikTok inbox as a draft; going public stays their tap."
        },
        "publishedUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "scheduledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "postedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "description": "The customer-facing reason a post did not go out (the same text the Posts page shows), at most 300 characters."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "postId",
        "clipId",
        "destinationId",
        "destinationName",
        "platform",
        "status",
        "publishedUrl",
        "scheduledAt",
        "postedAt",
        "error",
        "createdAt"
      ]
    }
  }
}