{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reachsocial-dev/json-schema/reachsocial-dev-job-status-schema.json",
  "title": "JobStatus",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reachsocial-dev-openapi.json#/components/schemas/JobStatus",
  "type": "object",
  "required": [
    "job_id",
    "service",
    "status",
    "created_at",
    "expires_at"
  ],
  "properties": {
    "job_id": {
      "type": "string"
    },
    "service": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "succeeded",
        "failed",
        "expired"
      ]
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "type": "string"
    },
    "result": {
      "$ref": "#/$defs/NormalizedResponse"
    },
    "error": {
      "$ref": "#/$defs/ReachSocialError"
    }
  },
  "$defs": {
    "Author": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "platform_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "handle": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "avatar_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "verified": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "canonical_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "ContentItem": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "platform",
        "canonical_url",
        "platform_id",
        "media",
        "metrics"
      ],
      "properties": {
        "platform": {
          "type": "string"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "platform_id": {
          "type": "string"
        },
        "type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "author": {
          "anyOf": [
            {
              "$ref": "#/$defs/Author"
            },
            {
              "type": "null"
            }
          ]
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "media": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Media"
          }
        },
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "relationships": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "Media": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "audio"
          ]
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "preview_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "width": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "height": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "NormalizedData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "profile": {
          "anyOf": [
            {
              "$ref": "#/$defs/Profile"
            },
            {
              "type": "null"
            }
          ]
        },
        "item": {
          "anyOf": [
            {
              "$ref": "#/$defs/ContentItem"
            },
            {
              "type": "null"
            }
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContentItem"
          }
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "has_more": {
          "type": "boolean"
        }
      }
    },
    "NormalizedResponse": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "request_id",
        "service",
        "status",
        "cached",
        "data",
        "meta"
      ],
      "properties": {
        "request_id": {
          "type": "string"
        },
        "service": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "success"
        },
        "cached": {
          "type": "boolean"
        },
        "data": {
          "$ref": "#/$defs/NormalizedData"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      }
    },
    "Profile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "platform",
        "canonical_url",
        "counts",
        "links",
        "fields"
      ],
      "properties": {
        "platform": {
          "type": "string"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "platform_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "handle": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "biography": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "avatar_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "verified": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "private": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "counts": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "links": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "fields": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "ReachSocialError": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "code",
        "message",
        "retryable"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "ResponseMeta": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema_version",
        "normalization_version",
        "response_shape",
        "latency_ms"
      ],
      "properties": {
        "schema_version": {
          "type": "string",
          "const": "1.0"
        },
        "normalization_version": {
          "type": "string",
          "const": "v1"
        },
        "response_shape": {
          "type": "string",
          "enum": [
            "profile",
            "item",
            "feed",
            "stories"
          ]
        },
        "latency_ms": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}