{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pinbridge-io/json-schema/pinbridge-io-pin-response-schema.json",
  "title": "PinResponse",
  "description": "Response schema for a pin.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pinbridge-io-openapi.json#/components/schemas/PinResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "title": "Workspace Id"
    },
    "pinterest_account_id": {
      "type": "string",
      "format": "uuid",
      "title": "Pinterest Account Id"
    },
    "status": {
      "$ref": "#/$defs/PinStatus"
    },
    "media_type": {
      "$ref": "#/$defs/PinMediaType"
    },
    "title": {
      "type": "string",
      "title": "Title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "related_terms": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Related Terms",
      "description": "No longer sent to Pinterest. Null for pins created from 1.65.1 on.",
      "deprecated": true
    },
    "alt_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Alt Text"
    },
    "dominant_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Dominant Color"
    },
    "cover_image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cover Image Url"
    },
    "link_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Link Url"
    },
    "media_url": {
      "type": "string",
      "title": "Media Url"
    },
    "image_url": {
      "type": "string",
      "title": "Image Url"
    },
    "asset_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Asset Id"
    },
    "board_id": {
      "type": "string",
      "title": "Board Id"
    },
    "template_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Id",
      "description": "The pin template the image was drawn with"
    },
    "template_version": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Version",
      "description": "Version of template_id used"
    },
    "pinterest_pin_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pinterest Pin Id"
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Code"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Message"
    },
    "idempotency_key": {
      "type": "string",
      "title": "Idempotency Key"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "published_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Published At"
    },
    "failed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Failed At",
      "description": "When the pin failed; set only while status is failed and cleared by a retry, like error_code"
    },
    "removed_from_pinterest_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Removed From Pinterest At",
      "description": "When PinBridge found that this published pin no longer exists on Pinterest (deleted there by hand or with its board). The pin keeps status published; null means it is live or has not been checked."
    }
  },
  "type": "object",
  "required": [
    "id",
    "workspace_id",
    "pinterest_account_id",
    "status",
    "media_type",
    "title",
    "media_url",
    "image_url",
    "board_id",
    "idempotency_key",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "PinMediaType": {
      "type": "string",
      "enum": [
        "image",
        "video"
      ],
      "title": "PinMediaType",
      "description": "Pin media type enum."
    },
    "PinStatus": {
      "type": "string",
      "enum": [
        "queued",
        "deferred",
        "publishing",
        "published",
        "failed"
      ],
      "title": "PinStatus",
      "description": "Pin status enum."
    }
  }
}