{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/listings-api/json-schema/listings-api-social-post-mutation-schema.json",
  "title": "SocialPostMutation",
  "description": "Result of a social post create/edit mutation.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/listings-api-posts-api-openapi.yml#/components/schemas/SocialPostMutation",
  "type": "object",
  "properties": {
    "clientMutationId": {
      "type": "string"
    },
    "success": {
      "type": "boolean"
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MutationError"
      }
    },
    "socialPost": {
      "$ref": "#/$defs/SocialPost"
    }
  },
  "required": [
    "success"
  ],
  "$defs": {
    "ContextError": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "MediaTypeEnum": {
      "type": "string",
      "enum": [
        "IMAGE",
        "VIDEO"
      ],
      "description": "Media type for social posts."
    },
    "MutationError": {
      "type": "object",
      "description": "(also defined by insights) (also defined by v2app)",
      "properties": {
        "message": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "contextInfo": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContextError"
          }
        }
      }
    },
    "PostContextInfo": {
      "type": "object",
      "properties": {
        "couponCode": {
          "type": "string"
        },
        "redeemUrl": {
          "type": "string"
        },
        "termsConditions": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "discount": {
          "type": "string"
        },
        "locationType": {
          "type": "string"
        },
        "startDay": {
          "type": "string",
          "format": "date"
        },
        "startTime": {
          "type": "string"
        },
        "endDay": {
          "type": "string",
          "format": "date"
        },
        "endTime": {
          "type": "string"
        }
      }
    },
    "PostCta": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/$defs/SiteCtaTypes"
        },
        "url": {
          "type": "string"
        },
        "site": {
          "$ref": "#/$defs/SitesType"
        },
        "tinyUrl": {
          "type": "string"
        }
      }
    },
    "PostMessage": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "site": {
          "$ref": "#/$defs/SitesType"
        }
      }
    },
    "PublishStatusEnum": {
      "type": "string",
      "enum": [
        "PUBLISHING",
        "PUBLISHED",
        "DELETED",
        "EXPIRED",
        "ERROR"
      ],
      "description": "Publish statuses per site."
    },
    "SiteCtaTypes": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "SitesType": {
      "type": "string",
      "enum": [
        "GOOGLE",
        "FACEBOOK"
      ],
      "description": "Sites a post can be published to."
    },
    "SocialPost": {
      "type": "object",
      "description": "A newer multi-site/multi-location post campaign.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/SocialPostStatusEnum"
        },
        "type": {
          "$ref": "#/$defs/SocialPostTypeEnum"
        },
        "createdAt": {
          "type": "string",
          "format": "date"
        },
        "deletedAt": {
          "type": "string",
          "format": "date"
        },
        "expiredAt": {
          "type": "string",
          "format": "date"
        },
        "scheduledStartDate": {
          "type": "string",
          "format": "date"
        },
        "scheduledEndDate": {
          "type": "string",
          "format": "date"
        },
        "views": {
          "type": "integer",
          "format": "int32"
        },
        "clicks": {
          "type": "integer",
          "format": "int32"
        },
        "shares": {
          "type": "integer",
          "format": "int32"
        },
        "reactions": {
          "type": "integer",
          "format": "int32"
        },
        "comments": {
          "type": "integer",
          "format": "int32"
        },
        "sites": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SitesType"
          }
        },
        "message": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostMessage"
          }
        },
        "cta": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PostCta"
          }
        },
        "contextInfo": {
          "$ref": "#/$defs/PostContextInfo"
        },
        "mediaUrl": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SocialPostMedia"
          }
        },
        "publishDetails": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SocialPostPublishDetail"
          }
        },
        "postLinks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SocialPostPublishedLink"
          }
        },
        "locationIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "required": [
        "id",
        "name",
        "status",
        "type",
        "createdAt",
        "sites",
        "locationIds"
      ]
    },
    "SocialPostMedia": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "site": {
          "$ref": "#/$defs/SitesType"
        },
        "type": {
          "$ref": "#/$defs/MediaTypeEnum"
        }
      }
    },
    "SocialPostPublishDetail": {
      "type": "object",
      "properties": {
        "site": {
          "$ref": "#/$defs/SitesType"
        },
        "status": {
          "$ref": "#/$defs/PublishStatusEnum"
        },
        "createdDate": {
          "type": "string",
          "format": "date"
        },
        "publishedDate": {
          "type": "string",
          "format": "date"
        },
        "deletedDate": {
          "type": "string",
          "format": "date"
        },
        "expiredDate": {
          "type": "string",
          "format": "date"
        },
        "submissionError": {
          "type": "string"
        }
      }
    },
    "SocialPostPublishedLink": {
      "type": "object",
      "properties": {
        "site": {
          "$ref": "#/$defs/SitesType"
        },
        "link": {
          "type": "string"
        }
      }
    },
    "SocialPostStatusEnum": {
      "type": "string",
      "enum": [
        "INPROGRESS",
        "SCHEDULED",
        "SUCCESS",
        "ERROR",
        "DELETED",
        "EXPIRED"
      ],
      "description": "Social Post lifecycle statuses."
    },
    "SocialPostTypeEnum": {
      "type": "string",
      "enum": [
        "EVENT",
        "OFFER",
        "ANNOUNCEMENT",
        "COVID19",
        "PRODUCT"
      ],
      "description": "Social Post types."
    }
  }
}