{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/socialync-io/json-schema/socialync-io-post-result-schema.json",
  "title": "PostResult",
  "description": "An immediate publish returns status published or partial with per platform results. A scheduled post returns status scheduled, its id (the groupId when it goes to several platforms) and scheduledPostIds. Other fields from the publish pipeline, such as dailyDraftsRemaining, are passed through.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/socialync-io-openapi.json#/components/schemas/PostResult",
  "type": "object",
  "required": [
    "id",
    "status"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Use this id with GET, PATCH and DELETE /v1/posts/{id}."
    },
    "groupId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "published",
        "partial",
        "scheduled"
      ]
    },
    "draftId": {
      "type": "string"
    },
    "profileId": {
      "type": "string"
    },
    "profileName": {
      "type": "string"
    },
    "scheduledAt": {
      "type": "string",
      "format": "date-time"
    },
    "scheduledPostIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PlatformResult"
      }
    },
    "duplicate": {
      "type": "boolean",
      "description": "True when an identical publish a few minutes ago was returned instead of posting again."
    },
    "dailyDraftsRemaining": {
      "type": "integer",
      "description": "Posts left today on this profile."
    },
    "dailyDraftsLimit": {
      "type": "integer"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "PlatformResult": {
      "type": "object",
      "properties": {
        "platform": {
          "type": "string"
        },
        "success": {
          "type": "boolean"
        },
        "postId": {
          "type": "string"
        },
        "postUrl": {
          "type": "string"
        },
        "error": {
          "type": "string"
        }
      }
    }
  }
}