{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/preflight-social/json-schema/preflight-social-target-schema.json",
  "title": "Target",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/preflight-social-openapi.json#/components/schemas/Target",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "platform": {
      "$ref": "#/$defs/Platform"
    },
    "accountId": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "publishing",
        "published",
        "failed",
        "skipped"
      ]
    },
    "remoteId": {
      "type": [
        "string",
        "null"
      ]
    },
    "remoteUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "publishedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "errorCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "errorPermanent": {
      "type": "boolean",
      "description": "Retrying cannot succeed without changing something."
    },
    "attempts": {
      "type": "integer"
    },
    "nextAttemptAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "canEditRemote": {
      "type": "boolean"
    },
    "canDeleteRemote": {
      "type": "boolean"
    },
    "options": {
      "type": "object",
      "additionalProperties": true
    },
    "boostState": {
      "type": [
        "object",
        "null"
      ],
      "description": "Where options.boost stands: checkedAt and likes as last read; doneAt once it ran, with replyId and reposted, or expired when the window passed first."
    },
    "metrics": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true,
      "description": "The latest figures, with fetchedAt."
    }
  },
  "$defs": {
    "Platform": {
      "type": "string",
      "enum": [
        "youtube",
        "tiktok",
        "instagram",
        "facebook",
        "threads",
        "twitter",
        "linkedin",
        "pinterest",
        "bluesky",
        "mastodon",
        "telegram",
        "discord",
        "tumblr"
      ],
      "description": "A network's name. twitter (X) is text-only and not offered to new accounts."
    }
  }
}