{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrapeatlas/json-schema/scrapeatlas-bluesky-posts-batch-response-schema-schema.json",
  "title": "blueskyPostsBatchResponseSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrapeatlas-bluesky-api-openapi.yml#/components/schemas/blueskyPostsBatchResponseSchema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "accounting": {
          "type": "object",
          "properties": {
            "upstreamRequests": {
              "type": "integer",
              "minimum": 0
            },
            "responseBytes": {
              "type": "integer",
              "minimum": 0
            },
            "durationMs": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "upstreamRequests",
            "responseBytes",
            "durationMs"
          ],
          "additionalProperties": false
        },
        "success": {
          "type": "boolean",
          "const": true
        },
        "status": {
          "type": "string",
          "enum": [
            "success",
            "partial"
          ]
        },
        "sourceUrl": {
          "type": "string",
          "format": "uri"
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time"
        },
        "coverage": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "const": "public_api"
            },
            "complete": {
              "type": "boolean"
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "source",
            "complete",
            "warnings"
          ],
          "additionalProperties": false
        },
        "results": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "uri": {
                    "type": "string",
                    "maxLength": 2600,
                    "pattern": "^at:\\/\\/did:[^/]+\\/app\\.bsky\\.feed\\.post\\/[a-zA-Z0-9._~:-]{1,512}$",
                    "x-runtime-refinement": true
                  },
                  "status": {
                    "type": "string",
                    "const": "success"
                  },
                  "post": {
                    "type": "object",
                    "properties": {
                      "uri": {
                        "type": "string",
                        "pattern": "^at:\\/\\/did:[^/]+\\/app\\.bsky\\.feed\\.post\\/[^/]+$"
                      },
                      "cid": {
                        "type": "string",
                        "minLength": 1
                      },
                      "author": {
                        "type": "object",
                        "properties": {
                          "did": {
                            "type": "string",
                            "maxLength": 2048,
                            "pattern": "^did:(?:plc:[a-z2-7]{24}|web:[a-zA-Z0-9._:%-]+(?::[a-zA-Z0-9._:%-]+)*)$"
                          },
                          "handle": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "did",
                          "handle"
                        ],
                        "additionalProperties": true
                      },
                      "record": {
                        "type": "object",
                        "properties": {
                          "$type": {
                            "type": "string",
                            "const": "app.bsky.feed.post"
                          },
                          "text": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "$type",
                          "text",
                          "createdAt"
                        ],
                        "additionalProperties": true
                      },
                      "replyCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "repostCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "likeCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "quoteCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "indexedAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "uri",
                      "cid",
                      "author",
                      "record",
                      "replyCount",
                      "repostCount",
                      "likeCount",
                      "quoteCount",
                      "indexedAt"
                    ],
                    "additionalProperties": true
                  }
                },
                "required": [
                  "uri",
                  "status",
                  "post"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "uri": {
                    "type": "string",
                    "maxLength": 2600,
                    "pattern": "^at:\\/\\/did:[^/]+\\/app\\.bsky\\.feed\\.post\\/[a-zA-Z0-9._~:-]{1,512}$",
                    "x-runtime-refinement": true
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "unavailable",
                      "restricted"
                    ]
                  },
                  "post": {
                    "type": "null"
                  }
                },
                "required": [
                  "uri",
                  "status",
                  "post"
                ],
                "additionalProperties": false
              }
            ]
          },
          "minItems": 1,
          "maxItems": 25
        }
      },
      "required": [
        "requestId",
        "accounting",
        "success",
        "status",
        "sourceUrl",
        "fetchedAt",
        "coverage",
        "results"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "accounting": {
          "type": "object",
          "properties": {
            "upstreamRequests": {
              "type": "integer",
              "minimum": 0
            },
            "responseBytes": {
              "type": "integer",
              "minimum": 0
            },
            "durationMs": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "upstreamRequests",
            "responseBytes",
            "durationMs"
          ],
          "additionalProperties": false
        },
        "success": {
          "type": "boolean",
          "const": false
        },
        "status": {
          "type": "string",
          "enum": [
            "failed",
            "challenged"
          ]
        },
        "failure": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "enum": [
                "invalid_request",
                "unauthorized",
                "not_found",
                "unavailable_records",
                "upstream_challenged",
                "upstream_rate_limited",
                "upstream_error",
                "unsupported_page",
                "restricted_page",
                "response_too_large",
                "unsafe_redirect",
                "request_limit",
                "timeout",
                "busy",
                "payload_too_complex"
              ]
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "requestId",
        "accounting",
        "success",
        "status",
        "failure"
      ],
      "additionalProperties": false
    }
  ]
}