{
  "openapi": "3.1.0",
  "info": {
    "title": "Pubrivo API",
    "version": "unversioned",
    "description": "Schedule and publish to Facebook, Instagram, TikTok, YouTube and Threads. Guides at https://www.pubrivo.com/developers. Additive only: fields are added, never renamed or removed."
  },
  "tags": [
    {
      "name": "Channels"
    },
    {
      "name": "Posts"
    },
    {
      "name": "Variants"
    },
    {
      "name": "Media"
    },
    {
      "name": "Webhooks"
    }
  ],
  "x-pubrivo-limits": {
    "requestsPerMinute": 60,
    "scheduleFloorMinutes": 15,
    "dedupeMinutes": 10,
    "pageDefault": 100,
    "pageMax": 500
  },
  "webhooks": {
    "variant.published": {
      "post": {
        "summary": "A Variant published",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "Pubrivo-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint’s secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The event’s id. A delivery can arrive more than once: dedupe on this."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "variant.published",
                      "variant.failed"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "variant": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "channelId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "channelName": {
                            "type": "string"
                          },
                          "network": {
                            "type": "string",
                            "enum": [
                              "facebook",
                              "instagram",
                              "tiktok",
                              "youtube",
                              "x",
                              "threads"
                            ]
                          },
                          "placement": {
                            "type": "string",
                            "enum": [
                              "feed",
                              "story"
                            ],
                            "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "scheduled",
                              "publishing",
                              "published",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "scheduledAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failureReason": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "needs_reconnect",
                                  "rejected_by_platform",
                                  "media_problem",
                                  "rate_limited",
                                  "missed_window",
                                  "platform_problem",
                                  "unconfirmed"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failureDetail": {
                            "description": "What the Network said, when a Variant failed.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "permalink": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "mediaReady": {
                            "type": "boolean",
                            "description": "Every file of the Post is ready for this Network."
                          },
                          "channelDisconnected": {
                            "type": "boolean"
                          },
                          "cancelledByDisconnect": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "by": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "by"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                          },
                          "metrics": {
                            "type": "null",
                            "description": "Always null in a webhook. Read the Post for its counts."
                          }
                        },
                        "required": [
                          "id",
                          "channelId",
                          "channelName",
                          "network",
                          "placement",
                          "status",
                          "scheduledAt",
                          "failureReason",
                          "failureDetail",
                          "permalink",
                          "mediaReady",
                          "channelDisconnected",
                          "cancelledByDisconnect",
                          "metrics"
                        ],
                        "additionalProperties": false
                      },
                      "post": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "text": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "description": "Its earliest scheduled time, or when it was written."
                          },
                          "via": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "key",
                                      "app"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "by": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "name",
                                  "by"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                          },
                          "media": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video"
                                  ]
                                },
                                "altText": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The file on Pubrivo’s media domain; null until its upload lands."
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "altText",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Its files, in carousel order."
                          },
                          "variants": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelName": {
                                  "type": "string"
                                },
                                "network": {
                                  "type": "string",
                                  "enum": [
                                    "facebook",
                                    "instagram",
                                    "tiktok",
                                    "youtube",
                                    "x",
                                    "threads"
                                  ]
                                },
                                "placement": {
                                  "type": "string",
                                  "enum": [
                                    "feed",
                                    "story"
                                  ],
                                  "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "draft",
                                    "scheduled",
                                    "publishing",
                                    "published",
                                    "failed",
                                    "cancelled"
                                  ]
                                },
                                "scheduledAt": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureReason": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "needs_reconnect",
                                        "rejected_by_platform",
                                        "media_problem",
                                        "rate_limited",
                                        "missed_window",
                                        "platform_problem",
                                        "unconfirmed"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureDetail": {
                                  "description": "What the Network said, when a Variant failed.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "permalink": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "mediaReady": {
                                  "type": "boolean",
                                  "description": "Every file of the Post is ready for this Network."
                                },
                                "channelDisconnected": {
                                  "type": "boolean"
                                },
                                "cancelledByDisconnect": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "by": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "by"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                                },
                                "metrics": {
                                  "type": "null",
                                  "description": "Always null in a webhook. Read the Post for its counts."
                                }
                              },
                              "required": [
                                "id",
                                "channelId",
                                "channelName",
                                "network",
                                "placement",
                                "status",
                                "scheduledAt",
                                "failureReason",
                                "failureDetail",
                                "permalink",
                                "mediaReady",
                                "channelDisconnected",
                                "cancelledByDisconnect",
                                "metrics"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "text",
                          "createdAt",
                          "at",
                          "via",
                          "media",
                          "variants"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "variant",
                      "post"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is tried again."
          }
        }
      }
    },
    "variant.failed": {
      "post": {
        "summary": "A Variant failed",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "Pubrivo-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint’s secret>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
                    "description": "The event’s id. A delivery can arrive more than once: dedupe on this."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "variant.published",
                      "variant.failed"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "variant": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "channelId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "channelName": {
                            "type": "string"
                          },
                          "network": {
                            "type": "string",
                            "enum": [
                              "facebook",
                              "instagram",
                              "tiktok",
                              "youtube",
                              "x",
                              "threads"
                            ]
                          },
                          "placement": {
                            "type": "string",
                            "enum": [
                              "feed",
                              "story"
                            ],
                            "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "scheduled",
                              "publishing",
                              "published",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "scheduledAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failureReason": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "needs_reconnect",
                                  "rejected_by_platform",
                                  "media_problem",
                                  "rate_limited",
                                  "missed_window",
                                  "platform_problem",
                                  "unconfirmed"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "failureDetail": {
                            "description": "What the Network said, when a Variant failed.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "permalink": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "mediaReady": {
                            "type": "boolean",
                            "description": "Every file of the Post is ready for this Network."
                          },
                          "channelDisconnected": {
                            "type": "boolean"
                          },
                          "cancelledByDisconnect": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "by": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "by"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                          },
                          "metrics": {
                            "type": "null",
                            "description": "Always null in a webhook. Read the Post for its counts."
                          }
                        },
                        "required": [
                          "id",
                          "channelId",
                          "channelName",
                          "network",
                          "placement",
                          "status",
                          "scheduledAt",
                          "failureReason",
                          "failureDetail",
                          "permalink",
                          "mediaReady",
                          "channelDisconnected",
                          "cancelledByDisconnect",
                          "metrics"
                        ],
                        "additionalProperties": false
                      },
                      "post": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "text": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "description": "Its earliest scheduled time, or when it was written."
                          },
                          "via": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "key",
                                      "app"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "by": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "name",
                                  "by"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                          },
                          "media": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video"
                                  ]
                                },
                                "altText": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The file on Pubrivo’s media domain; null until its upload lands."
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "altText",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Its files, in carousel order."
                          },
                          "variants": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelName": {
                                  "type": "string"
                                },
                                "network": {
                                  "type": "string",
                                  "enum": [
                                    "facebook",
                                    "instagram",
                                    "tiktok",
                                    "youtube",
                                    "x",
                                    "threads"
                                  ]
                                },
                                "placement": {
                                  "type": "string",
                                  "enum": [
                                    "feed",
                                    "story"
                                  ],
                                  "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "draft",
                                    "scheduled",
                                    "publishing",
                                    "published",
                                    "failed",
                                    "cancelled"
                                  ]
                                },
                                "scheduledAt": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureReason": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "needs_reconnect",
                                        "rejected_by_platform",
                                        "media_problem",
                                        "rate_limited",
                                        "missed_window",
                                        "platform_problem",
                                        "unconfirmed"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureDetail": {
                                  "description": "What the Network said, when a Variant failed.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "permalink": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "mediaReady": {
                                  "type": "boolean",
                                  "description": "Every file of the Post is ready for this Network."
                                },
                                "channelDisconnected": {
                                  "type": "boolean"
                                },
                                "cancelledByDisconnect": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "by": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "by"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                                },
                                "metrics": {
                                  "type": "null",
                                  "description": "Always null in a webhook. Read the Post for its counts."
                                }
                              },
                              "required": [
                                "id",
                                "channelId",
                                "channelName",
                                "network",
                                "placement",
                                "status",
                                "scheduledAt",
                                "failureReason",
                                "failureDetail",
                                "permalink",
                                "mediaReady",
                                "channelDisconnected",
                                "cancelledByDisconnect",
                                "metrics"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "text",
                          "createdAt",
                          "at",
                          "via",
                          "media",
                          "variants"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "variant",
                      "post"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is tried again."
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://app.pubrivo.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "pbv_… API key"
      }
    }
  },
  "paths": {
    "/api/channels": {
      "get": {
        "summary": "List Channels",
        "description": "The Workspace’s live Channels, oldest first, and whether each can take a Post now.",
        "tags": [
          "Channels"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "list_channels",
            "does": "Lists the Workspace’s Channels, and whether each can take a Post now",
            "readOnly": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "network": {
                            "type": "string",
                            "enum": [
                              "facebook",
                              "instagram",
                              "tiktok",
                              "youtube",
                              "x",
                              "threads"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "avatarUrl": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "connected",
                              "needs_reconnect",
                              "not_connected"
                            ]
                          },
                          "canPostNow": {
                            "type": "boolean",
                            "description": "Its Connection is healthy. Plan limits are judged when a Post is created."
                          }
                        },
                        "required": [
                          "id",
                          "network",
                          "name",
                          "avatarUrl",
                          "state",
                          "canPostNow"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/posts": {
      "get": {
        "summary": "List Posts",
        "description": "Posts, newest written first, a page at a time. With from/to, only Posts with a Variant scheduled — or written — in that range.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "list_posts",
            "does": "Lists Posts and where each has got to, optionally in a date range",
            "readOnly": true
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only Posts written, or with a Variant scheduled, at or after this instant.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only Posts written, or with a Variant scheduled, before this instant.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Posts a page, up to 500. 100 when omitted.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the page before.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "text": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "description": "Its earliest scheduled time, or when it was written."
                          },
                          "via": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "key",
                                      "app"
                                    ]
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "by": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "name",
                                  "by"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                          },
                          "media": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "image",
                                    "video"
                                  ]
                                },
                                "altText": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "url": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The file on Pubrivo’s media domain; null until its upload lands."
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "altText",
                                "url"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Its files, in carousel order."
                          },
                          "variants": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "channelName": {
                                  "type": "string"
                                },
                                "network": {
                                  "type": "string",
                                  "enum": [
                                    "facebook",
                                    "instagram",
                                    "tiktok",
                                    "youtube",
                                    "x",
                                    "threads"
                                  ]
                                },
                                "placement": {
                                  "type": "string",
                                  "enum": [
                                    "feed",
                                    "story"
                                  ],
                                  "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "draft",
                                    "scheduled",
                                    "publishing",
                                    "published",
                                    "failed",
                                    "cancelled"
                                  ]
                                },
                                "scheduledAt": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureReason": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "needs_reconnect",
                                        "rejected_by_platform",
                                        "media_problem",
                                        "rate_limited",
                                        "missed_window",
                                        "platform_problem",
                                        "unconfirmed"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "failureDetail": {
                                  "description": "What the Network said, when a Variant failed.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "permalink": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "mediaReady": {
                                  "type": "boolean",
                                  "description": "Every file of the Post is ready for this Network."
                                },
                                "channelDisconnected": {
                                  "type": "boolean"
                                },
                                "cancelledByDisconnect": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "by": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "by"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                                },
                                "metrics": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "asOf": {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                            },
                                            "counts": {
                                              "type": "object",
                                              "properties": {
                                                "views": {
                                                  "description": "Times the post was shown or played.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "reach": {
                                                  "description": "Accounts that saw it at least once.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "reactions": {
                                                  "description": "Every reaction, summed.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "reactionsByType": {
                                                  "description": "The reactions by kind. like includes care.",
                                                  "type": "object",
                                                  "properties": {
                                                    "like": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "love": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "wow": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "haha": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "sorry": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "anger": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                },
                                                "clicks": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "likes": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "comments": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "shares": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "saves": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "interactions": {
                                                  "description": "The Network’s own total of the interactions above.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "minutesWatched": {
                                                  "description": "Minutes of the video watched, as the Network estimates.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "averageViewDuration": {
                                                  "description": "Seconds watched in an average view.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                },
                                                "averageViewPercentage": {
                                                  "description": "The share of the video an average view watched, in percent.",
                                                  "type": "number",
                                                  "minimum": 0
                                                },
                                                "subscribersGained": {
                                                  "description": "Subscribers who joined from this video.",
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            "days": {
                                              "description": "The same counts by day, where the Network reports a series. Its latest days lag by up to three.",
                                              "type": "array",
                                              "items": {
                                                "type": "object",
                                                "properties": {
                                                  "date": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                                  },
                                                  "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                      "views": {
                                                        "description": "Times the post was shown or played.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "reach": {
                                                        "description": "Accounts that saw it at least once.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "reactions": {
                                                        "description": "Every reaction, summed.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "reactionsByType": {
                                                        "description": "The reactions by kind. like includes care.",
                                                        "type": "object",
                                                        "properties": {
                                                          "like": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          },
                                                          "love": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          },
                                                          "wow": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          },
                                                          "haha": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          },
                                                          "sorry": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          },
                                                          "anger": {
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 9007199254740991
                                                          }
                                                        },
                                                        "additionalProperties": false
                                                      },
                                                      "clicks": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "likes": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "comments": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "shares": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "saves": {
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "interactions": {
                                                        "description": "The Network’s own total of the interactions above.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "minutesWatched": {
                                                        "description": "Minutes of the video watched, as the Network estimates.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "averageViewDuration": {
                                                        "description": "Seconds watched in an average view.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      },
                                                      "averageViewPercentage": {
                                                        "description": "The share of the video an average view watched, in percent.",
                                                        "type": "number",
                                                        "minimum": 0
                                                      },
                                                      "subscribersGained": {
                                                        "description": "Subscribers who joined from this video.",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 9007199254740991
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                },
                                                "required": [
                                                  "date",
                                                  "counts"
                                                ],
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "required": [
                                            "asOf",
                                            "counts"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "asOf": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "unavailable": {
                                              "type": "string",
                                              "enum": [
                                                "page_below_threshold",
                                                "instagram_delay",
                                                "no_analyze_task",
                                                "no_post_id",
                                                "not_yet",
                                                "reconnect"
                                              ],
                                              "description": "Why there are no counts to show."
                                            }
                                          },
                                          "required": [
                                            "asOf",
                                            "unavailable"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Counts the Network reports for this published post, when Pubrivo can read them; otherwise null."
                                }
                              },
                              "required": [
                                "id",
                                "channelId",
                                "channelName",
                                "network",
                                "placement",
                                "status",
                                "scheduledAt",
                                "failureReason",
                                "failureDetail",
                                "permalink",
                                "mediaReady",
                                "channelDisconnected",
                                "cancelledByDisconnect",
                                "metrics"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "text",
                          "createdAt",
                          "at",
                          "via",
                          "media",
                          "variants"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a Post",
        "description": "Create a Post: one Variant per Channel, published now or at scheduledAt. A refusal lists each reason as a blocker.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "schedule_post",
            "does": "Schedules a Post to one or more Channels, at least 15 minutes ahead",
            "readOnly": false
          },
          {
            "name": "publish_now",
            "does": "Publishes a Post now — only if you allowed it at approval",
            "readOnly": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "scheduledAt": {
                    "description": "When to publish: an ISO 8601 instant with Z or an offset, as YYYY-MM-DDTHH:mm:ssZ — within the next year. Omit to publish now.",
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "channelIds": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "media": {
                    "default": [],
                    "description": "Files, in order: one uploaded with POST /api/media ({ assetId }), or a public https URL ({ url }) that Pubrivo fetches before publishing. JPEG, PNG, WebP, MP4 or MOV, up to 2 GB.",
                    "maxItems": 35,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "assetId": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "altText": {
                              "type": "string",
                              "maxLength": 1000
                            }
                          },
                          "required": [
                            "assetId"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "altText": {
                              "type": "string",
                              "maxLength": 1000
                            }
                          },
                          "required": [
                            "url"
                          ]
                        }
                      ]
                    }
                  },
                  "channelOptions": {
                    "default": {},
                    "description": "Per Channel: its placement, TikTok’s choices, and YouTube’s made-for-kids answer and title.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "placement": {
                          "default": "feed",
                          "description": "Defaults to feed. Stories are supported only on Facebook Pages and Instagram; feed_and_story creates two Variants. A Story carries no text and exactly one image or video. Facebook feed video uses the Page video publishing endpoint; there is no separate Reel placement selector.",
                          "type": "string",
                          "enum": [
                            "feed",
                            "story",
                            "feed_and_story"
                          ]
                        },
                        "tiktok": {
                          "type": "object",
                          "properties": {
                            "privacy": {
                              "default": null,
                              "description": "Who can see it. Required by TikTok: a Post without it is blocked.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "PUBLIC_TO_EVERYONE",
                                    "MUTUAL_FOLLOW_FRIENDS",
                                    "FOLLOWER_OF_CREATOR",
                                    "SELF_ONLY"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowComments": {
                              "default": false,
                              "type": "boolean"
                            },
                            "allowDuet": {
                              "default": false,
                              "type": "boolean"
                            },
                            "allowStitch": {
                              "default": false,
                              "type": "boolean"
                            },
                            "disclose": {
                              "default": false,
                              "description": "Disclose commercial content.",
                              "type": "boolean"
                            },
                            "brandOrganic": {
                              "default": false,
                              "type": "boolean"
                            },
                            "brandedContent": {
                              "default": false,
                              "type": "boolean"
                            },
                            "caption": {
                              "description": "Defaults to the Post’s text.",
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        },
                        "youtube": {
                          "type": "object",
                          "properties": {
                            "madeForKids": {
                              "type": "boolean"
                            },
                            "title": {
                              "description": "Defaults to the Post’s first sentence, shortened at a word to fit 100 characters. A title you send is never shortened: over 100 is refused.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "madeForKids"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "text",
                  "channelIds"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "text": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "description": "Its earliest scheduled time, or when it was written."
                        },
                        "via": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "key",
                                    "app"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "by": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "name",
                                "by"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video"
                                ]
                              },
                              "altText": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "The file on Pubrivo’s media domain; null until its upload lands."
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "altText",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Its files, in carousel order."
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelName": {
                                "type": "string"
                              },
                              "network": {
                                "type": "string",
                                "enum": [
                                  "facebook",
                                  "instagram",
                                  "tiktok",
                                  "youtube",
                                  "x",
                                  "threads"
                                ]
                              },
                              "placement": {
                                "type": "string",
                                "enum": [
                                  "feed",
                                  "story"
                                ],
                                "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "scheduled",
                                  "publishing",
                                  "published",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "scheduledAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureReason": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "needs_reconnect",
                                      "rejected_by_platform",
                                      "media_problem",
                                      "rate_limited",
                                      "missed_window",
                                      "platform_problem",
                                      "unconfirmed"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureDetail": {
                                "description": "What the Network said, when a Variant failed.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "permalink": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mediaReady": {
                                "type": "boolean",
                                "description": "Every file of the Post is ready for this Network."
                              },
                              "channelDisconnected": {
                                "type": "boolean"
                              },
                              "cancelledByDisconnect": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "by": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "by"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                              },
                              "metrics": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "counts": {
                                            "type": "object",
                                            "properties": {
                                              "views": {
                                                "description": "Times the post was shown or played.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reach": {
                                                "description": "Accounts that saw it at least once.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactions": {
                                                "description": "Every reaction, summed.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactionsByType": {
                                                "description": "The reactions by kind. like includes care.",
                                                "type": "object",
                                                "properties": {
                                                  "like": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "love": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "wow": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "haha": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "sorry": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "anger": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "clicks": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "likes": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "comments": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "shares": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "saves": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "interactions": {
                                                "description": "The Network’s own total of the interactions above.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "minutesWatched": {
                                                "description": "Minutes of the video watched, as the Network estimates.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewDuration": {
                                                "description": "Seconds watched in an average view.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewPercentage": {
                                                "description": "The share of the video an average view watched, in percent.",
                                                "type": "number",
                                                "minimum": 0
                                              },
                                              "subscribersGained": {
                                                "description": "Subscribers who joined from this video.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "days": {
                                            "description": "The same counts by day, where the Network reports a series. Its latest days lag by up to three.",
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "date": {
                                                  "type": "string",
                                                  "format": "date",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                                },
                                                "counts": {
                                                  "type": "object",
                                                  "properties": {
                                                    "views": {
                                                      "description": "Times the post was shown or played.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reach": {
                                                      "description": "Accounts that saw it at least once.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactions": {
                                                      "description": "Every reaction, summed.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactionsByType": {
                                                      "description": "The reactions by kind. like includes care.",
                                                      "type": "object",
                                                      "properties": {
                                                        "like": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "love": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "wow": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "haha": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "sorry": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "anger": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "clicks": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "likes": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "comments": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "shares": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "saves": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "interactions": {
                                                      "description": "The Network’s own total of the interactions above.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "minutesWatched": {
                                                      "description": "Minutes of the video watched, as the Network estimates.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewDuration": {
                                                      "description": "Seconds watched in an average view.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewPercentage": {
                                                      "description": "The share of the video an average view watched, in percent.",
                                                      "type": "number",
                                                      "minimum": 0
                                                    },
                                                    "subscribersGained": {
                                                      "description": "Subscribers who joined from this video.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "date",
                                                "counts"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "counts"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "unavailable": {
                                            "type": "string",
                                            "enum": [
                                              "page_below_threshold",
                                              "instagram_delay",
                                              "no_analyze_task",
                                              "no_post_id",
                                              "not_yet",
                                              "reconnect"
                                            ],
                                            "description": "Why there are no counts to show."
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "unavailable"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Counts the Network reports for this published post, when Pubrivo can read them; otherwise null."
                              }
                            },
                            "required": [
                              "id",
                              "channelId",
                              "channelName",
                              "network",
                              "placement",
                              "status",
                              "scheduledAt",
                              "failureReason",
                              "failureDetail",
                              "permalink",
                              "mediaReady",
                              "channelDisconnected",
                              "cancelledByDisconnect",
                              "metrics"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "text",
                        "createdAt",
                        "at",
                        "via",
                        "media",
                        "variants"
                      ],
                      "additionalProperties": false
                    },
                    "deduplicated": {
                      "type": "boolean",
                      "description": "An identical request from this credential was already accepted."
                    },
                    "existingPostId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "deduplicationReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "identical_request"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "deduplicated",
                    "existingPostId",
                    "deduplicationReason"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/posts/{id}": {
      "get": {
        "summary": "Get a Post",
        "description": "One Post, with where each of its Variants has got to.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "get_post",
            "does": "Reads one Post, including media readiness and failure details",
            "readOnly": true
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "text": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "description": "Its earliest scheduled time, or when it was written."
                        },
                        "via": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "key",
                                    "app"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "by": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "name",
                                "by"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video"
                                ]
                              },
                              "altText": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "The file on Pubrivo’s media domain; null until its upload lands."
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "altText",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Its files, in carousel order."
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelName": {
                                "type": "string"
                              },
                              "network": {
                                "type": "string",
                                "enum": [
                                  "facebook",
                                  "instagram",
                                  "tiktok",
                                  "youtube",
                                  "x",
                                  "threads"
                                ]
                              },
                              "placement": {
                                "type": "string",
                                "enum": [
                                  "feed",
                                  "story"
                                ],
                                "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "scheduled",
                                  "publishing",
                                  "published",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "scheduledAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureReason": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "needs_reconnect",
                                      "rejected_by_platform",
                                      "media_problem",
                                      "rate_limited",
                                      "missed_window",
                                      "platform_problem",
                                      "unconfirmed"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureDetail": {
                                "description": "What the Network said, when a Variant failed.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "permalink": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mediaReady": {
                                "type": "boolean",
                                "description": "Every file of the Post is ready for this Network."
                              },
                              "channelDisconnected": {
                                "type": "boolean"
                              },
                              "cancelledByDisconnect": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "by": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "by"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                              },
                              "metrics": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "counts": {
                                            "type": "object",
                                            "properties": {
                                              "views": {
                                                "description": "Times the post was shown or played.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reach": {
                                                "description": "Accounts that saw it at least once.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactions": {
                                                "description": "Every reaction, summed.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactionsByType": {
                                                "description": "The reactions by kind. like includes care.",
                                                "type": "object",
                                                "properties": {
                                                  "like": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "love": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "wow": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "haha": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "sorry": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "anger": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "clicks": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "likes": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "comments": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "shares": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "saves": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "interactions": {
                                                "description": "The Network’s own total of the interactions above.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "minutesWatched": {
                                                "description": "Minutes of the video watched, as the Network estimates.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewDuration": {
                                                "description": "Seconds watched in an average view.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewPercentage": {
                                                "description": "The share of the video an average view watched, in percent.",
                                                "type": "number",
                                                "minimum": 0
                                              },
                                              "subscribersGained": {
                                                "description": "Subscribers who joined from this video.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "days": {
                                            "description": "The same counts by day, where the Network reports a series. Its latest days lag by up to three.",
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "date": {
                                                  "type": "string",
                                                  "format": "date",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                                },
                                                "counts": {
                                                  "type": "object",
                                                  "properties": {
                                                    "views": {
                                                      "description": "Times the post was shown or played.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reach": {
                                                      "description": "Accounts that saw it at least once.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactions": {
                                                      "description": "Every reaction, summed.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactionsByType": {
                                                      "description": "The reactions by kind. like includes care.",
                                                      "type": "object",
                                                      "properties": {
                                                        "like": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "love": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "wow": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "haha": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "sorry": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "anger": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "clicks": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "likes": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "comments": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "shares": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "saves": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "interactions": {
                                                      "description": "The Network’s own total of the interactions above.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "minutesWatched": {
                                                      "description": "Minutes of the video watched, as the Network estimates.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewDuration": {
                                                      "description": "Seconds watched in an average view.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewPercentage": {
                                                      "description": "The share of the video an average view watched, in percent.",
                                                      "type": "number",
                                                      "minimum": 0
                                                    },
                                                    "subscribersGained": {
                                                      "description": "Subscribers who joined from this video.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "date",
                                                "counts"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "counts"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "unavailable": {
                                            "type": "string",
                                            "enum": [
                                              "page_below_threshold",
                                              "instagram_delay",
                                              "no_analyze_task",
                                              "no_post_id",
                                              "not_yet",
                                              "reconnect"
                                            ],
                                            "description": "Why there are no counts to show."
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "unavailable"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Counts the Network reports for this published post, when Pubrivo can read them; otherwise null."
                              }
                            },
                            "required": [
                              "id",
                              "channelId",
                              "channelName",
                              "network",
                              "placement",
                              "status",
                              "scheduledAt",
                              "failureReason",
                              "failureDetail",
                              "permalink",
                              "mediaReady",
                              "channelDisconnected",
                              "cancelledByDisconnect",
                              "metrics"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "text",
                        "createdAt",
                        "at",
                        "via",
                        "media",
                        "variants"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/posts/{id}/cancel": {
      "post": {
        "summary": "Cancel a Post",
        "description": "Cancel the Post’s Variants that have not started publishing. The rest are listed, never claimed.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "cancel_post",
            "does": "Cancels a Post’s Variants that have not started publishing",
            "readOnly": false
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "text": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "description": "Its earliest scheduled time, or when it was written."
                        },
                        "via": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "key",
                                    "app"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "by": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "name",
                                "by"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video"
                                ]
                              },
                              "altText": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "The file on Pubrivo’s media domain; null until its upload lands."
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "altText",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Its files, in carousel order."
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelName": {
                                "type": "string"
                              },
                              "network": {
                                "type": "string",
                                "enum": [
                                  "facebook",
                                  "instagram",
                                  "tiktok",
                                  "youtube",
                                  "x",
                                  "threads"
                                ]
                              },
                              "placement": {
                                "type": "string",
                                "enum": [
                                  "feed",
                                  "story"
                                ],
                                "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "scheduled",
                                  "publishing",
                                  "published",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "scheduledAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureReason": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "needs_reconnect",
                                      "rejected_by_platform",
                                      "media_problem",
                                      "rate_limited",
                                      "missed_window",
                                      "platform_problem",
                                      "unconfirmed"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureDetail": {
                                "description": "What the Network said, when a Variant failed.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "permalink": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mediaReady": {
                                "type": "boolean",
                                "description": "Every file of the Post is ready for this Network."
                              },
                              "channelDisconnected": {
                                "type": "boolean"
                              },
                              "cancelledByDisconnect": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "by": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "by"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                              },
                              "metrics": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "counts": {
                                            "type": "object",
                                            "properties": {
                                              "views": {
                                                "description": "Times the post was shown or played.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reach": {
                                                "description": "Accounts that saw it at least once.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactions": {
                                                "description": "Every reaction, summed.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactionsByType": {
                                                "description": "The reactions by kind. like includes care.",
                                                "type": "object",
                                                "properties": {
                                                  "like": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "love": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "wow": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "haha": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "sorry": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "anger": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "clicks": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "likes": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "comments": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "shares": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "saves": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "interactions": {
                                                "description": "The Network’s own total of the interactions above.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "minutesWatched": {
                                                "description": "Minutes of the video watched, as the Network estimates.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewDuration": {
                                                "description": "Seconds watched in an average view.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewPercentage": {
                                                "description": "The share of the video an average view watched, in percent.",
                                                "type": "number",
                                                "minimum": 0
                                              },
                                              "subscribersGained": {
                                                "description": "Subscribers who joined from this video.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "days": {
                                            "description": "The same counts by day, where the Network reports a series. Its latest days lag by up to three.",
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "date": {
                                                  "type": "string",
                                                  "format": "date",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                                },
                                                "counts": {
                                                  "type": "object",
                                                  "properties": {
                                                    "views": {
                                                      "description": "Times the post was shown or played.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reach": {
                                                      "description": "Accounts that saw it at least once.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactions": {
                                                      "description": "Every reaction, summed.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactionsByType": {
                                                      "description": "The reactions by kind. like includes care.",
                                                      "type": "object",
                                                      "properties": {
                                                        "like": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "love": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "wow": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "haha": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "sorry": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "anger": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "clicks": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "likes": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "comments": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "shares": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "saves": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "interactions": {
                                                      "description": "The Network’s own total of the interactions above.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "minutesWatched": {
                                                      "description": "Minutes of the video watched, as the Network estimates.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewDuration": {
                                                      "description": "Seconds watched in an average view.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewPercentage": {
                                                      "description": "The share of the video an average view watched, in percent.",
                                                      "type": "number",
                                                      "minimum": 0
                                                    },
                                                    "subscribersGained": {
                                                      "description": "Subscribers who joined from this video.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "date",
                                                "counts"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "counts"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "unavailable": {
                                            "type": "string",
                                            "enum": [
                                              "page_below_threshold",
                                              "instagram_delay",
                                              "no_analyze_task",
                                              "no_post_id",
                                              "not_yet",
                                              "reconnect"
                                            ],
                                            "description": "Why there are no counts to show."
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "unavailable"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Counts the Network reports for this published post, when Pubrivo can read them; otherwise null."
                              }
                            },
                            "required": [
                              "id",
                              "channelId",
                              "channelName",
                              "network",
                              "placement",
                              "status",
                              "scheduledAt",
                              "failureReason",
                              "failureDetail",
                              "permalink",
                              "mediaReady",
                              "channelDisconnected",
                              "cancelledByDisconnect",
                              "metrics"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "text",
                        "createdAt",
                        "at",
                        "via",
                        "media",
                        "variants"
                      ],
                      "additionalProperties": false
                    },
                    "cancelled": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      }
                    },
                    "pastCancelling": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      }
                    }
                  },
                  "required": [
                    "data",
                    "cancelled",
                    "pastCancelling"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/variants/{id}/retry": {
      "post": {
        "summary": "Try a Variant again",
        "description": "Queue a failed Variant again, now.",
        "tags": [
          "Variants"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "text": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                          "description": "Its earliest scheduled time, or when it was written."
                        },
                        "via": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "key",
                                    "app"
                                  ]
                                },
                                "name": {
                                  "type": "string"
                                },
                                "by": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "name",
                                "by"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Made through an API key or an Authorized app: its name then, and the Member behind it."
                        },
                        "media": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "video"
                                ]
                              },
                              "altText": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "url": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "The file on Pubrivo’s media domain; null until its upload lands."
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "altText",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Its files, in carousel order."
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "channelName": {
                                "type": "string"
                              },
                              "network": {
                                "type": "string",
                                "enum": [
                                  "facebook",
                                  "instagram",
                                  "tiktok",
                                  "youtube",
                                  "x",
                                  "threads"
                                ]
                              },
                              "placement": {
                                "type": "string",
                                "enum": [
                                  "feed",
                                  "story"
                                ],
                                "description": "feed, or story on a Facebook Page or Instagram account. A Story has no text."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "draft",
                                  "scheduled",
                                  "publishing",
                                  "published",
                                  "failed",
                                  "cancelled"
                                ]
                              },
                              "scheduledAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureReason": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "needs_reconnect",
                                      "rejected_by_platform",
                                      "media_problem",
                                      "rate_limited",
                                      "missed_window",
                                      "platform_problem",
                                      "unconfirmed"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "failureDetail": {
                                "description": "What the Network said, when a Variant failed.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "permalink": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "mediaReady": {
                                "type": "boolean",
                                "description": "Every file of the Post is ready for this Network."
                              },
                              "channelDisconnected": {
                                "type": "boolean"
                              },
                              "cancelledByDisconnect": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "by": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "by"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "A Disconnect cancelled it, and whose; null by is a Downgrade."
                              },
                              "metrics": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                          },
                                          "counts": {
                                            "type": "object",
                                            "properties": {
                                              "views": {
                                                "description": "Times the post was shown or played.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reach": {
                                                "description": "Accounts that saw it at least once.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactions": {
                                                "description": "Every reaction, summed.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "reactionsByType": {
                                                "description": "The reactions by kind. like includes care.",
                                                "type": "object",
                                                "properties": {
                                                  "like": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "love": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "wow": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "haha": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "sorry": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  },
                                                  "anger": {
                                                    "type": "integer",
                                                    "minimum": 0,
                                                    "maximum": 9007199254740991
                                                  }
                                                },
                                                "additionalProperties": false
                                              },
                                              "clicks": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "likes": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "comments": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "shares": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "saves": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "interactions": {
                                                "description": "The Network’s own total of the interactions above.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "minutesWatched": {
                                                "description": "Minutes of the video watched, as the Network estimates.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewDuration": {
                                                "description": "Seconds watched in an average view.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              },
                                              "averageViewPercentage": {
                                                "description": "The share of the video an average view watched, in percent.",
                                                "type": "number",
                                                "minimum": 0
                                              },
                                              "subscribersGained": {
                                                "description": "Subscribers who joined from this video.",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "days": {
                                            "description": "The same counts by day, where the Network reports a series. Its latest days lag by up to three.",
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "date": {
                                                  "type": "string",
                                                  "format": "date",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                                                },
                                                "counts": {
                                                  "type": "object",
                                                  "properties": {
                                                    "views": {
                                                      "description": "Times the post was shown or played.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reach": {
                                                      "description": "Accounts that saw it at least once.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactions": {
                                                      "description": "Every reaction, summed.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "reactionsByType": {
                                                      "description": "The reactions by kind. like includes care.",
                                                      "type": "object",
                                                      "properties": {
                                                        "like": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "love": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "wow": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "haha": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "sorry": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        },
                                                        "anger": {
                                                          "type": "integer",
                                                          "minimum": 0,
                                                          "maximum": 9007199254740991
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    "clicks": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "likes": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "comments": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "shares": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "saves": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "interactions": {
                                                      "description": "The Network’s own total of the interactions above.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "minutesWatched": {
                                                      "description": "Minutes of the video watched, as the Network estimates.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewDuration": {
                                                      "description": "Seconds watched in an average view.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    },
                                                    "averageViewPercentage": {
                                                      "description": "The share of the video an average view watched, in percent.",
                                                      "type": "number",
                                                      "minimum": 0
                                                    },
                                                    "subscribersGained": {
                                                      "description": "Subscribers who joined from this video.",
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "required": [
                                                "date",
                                                "counts"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "counts"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "asOf": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "unavailable": {
                                            "type": "string",
                                            "enum": [
                                              "page_below_threshold",
                                              "instagram_delay",
                                              "no_analyze_task",
                                              "no_post_id",
                                              "not_yet",
                                              "reconnect"
                                            ],
                                            "description": "Why there are no counts to show."
                                          }
                                        },
                                        "required": [
                                          "asOf",
                                          "unavailable"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Counts the Network reports for this published post, when Pubrivo can read them; otherwise null."
                              }
                            },
                            "required": [
                              "id",
                              "channelId",
                              "channelName",
                              "network",
                              "placement",
                              "status",
                              "scheduledAt",
                              "failureReason",
                              "failureDetail",
                              "permalink",
                              "mediaReady",
                              "channelDisconnected",
                              "cancelledByDisconnect",
                              "metrics"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "text",
                        "createdAt",
                        "at",
                        "via",
                        "media",
                        "variants"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "409": {
            "description": "`channel_disconnected`: Its Channel is disconnected; connecting it again lets the Variant be tried again.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "`not_failed`: Only a failed Variant can be tried again. `plan_limit`: The Workspace has no Post credit left for this Variant.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/media": {
      "post": {
        "summary": "Reserve an upload",
        "description": "Reserve an upload: PUT the file to uploadUrl with its Content-Type, then POST /api/media/{id}/complete.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "create_media_upload",
            "does": "Reserves an upload for a local file: the assistant’s shell sends the bytes, not the chat",
            "readOnly": false
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1
                  },
                  "contentType": {
                    "type": "string",
                    "minLength": 1,
                    "description": "One of image/jpeg, image/png, image/webp, video/mp4, video/quicktime."
                  },
                  "bytes": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991,
                    "description": "The file’s exact size in bytes, up to 2 GB."
                  }
                },
                "required": [
                  "filename",
                  "contentType",
                  "bytes"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "assetId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "uploadUrl": {
                          "type": "string",
                          "format": "uri"
                        }
                      },
                      "required": [
                        "assetId",
                        "uploadUrl"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/media/{id}/complete": {
      "post": {
        "summary": "Complete an upload",
        "description": "Confirm an upload arrived whole. One that did not is removed.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "x-pubrivo-mcp-tools": [
          {
            "name": "complete_media_upload",
            "does": "Confirms the file arrived whole, so a Post can use it",
            "readOnly": false
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "assetId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        }
                      },
                      "required": [
                        "assetId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/media/{id}": {
      "delete": {
        "summary": "Remove an upload",
        "description": "Remove an upload not yet in a Post, freeing its storage at once.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "posts:schedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks": {
      "get": {
        "summary": "List webhooks",
        "description": "The Workspace’s webhook endpoints, the events each hears, and its latest deliveries.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "webhooks:manage",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "variant.published",
                                "variant.failed"
                              ]
                            }
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "recentDeliveries": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "eventId": {
                                  "type": "string",
                                  "format": "uuid",
                                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "variant.published",
                                    "variant.failed"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending",
                                    "delivered",
                                    "failed"
                                  ],
                                  "description": "pending: will be tried again at nextAttemptAt. failed: no 2xx within 24 hours."
                                },
                                "tries": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "How many times it has been sent so far."
                                },
                                "lastStatus": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Your endpoint’s HTTP status on the last try."
                                },
                                "lastError": {
                                  "description": "Why the last try did not count as delivered.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "nextAttemptAt": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "eventId",
                                "type",
                                "status",
                                "tries",
                                "lastStatus",
                                "lastError",
                                "createdAt",
                                "nextAttemptAt"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Its latest deliveries, newest first, kept 30 days after they settle."
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "events",
                          "createdAt",
                          "recentDeliveries"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Register a webhook",
        "description": "Send events to an https URL. The signing secret is in the answer, and never shown again.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "webhooks:manage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000,
                    "format": "uri",
                    "description": "An https URL on the public internet. Redirects are not followed."
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "variant.published",
                        "variant.failed"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "variant.published",
                              "variant.failed"
                            ]
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                        },
                        "recentDeliveries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "eventId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "variant.published",
                                  "variant.failed"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "delivered",
                                  "failed"
                                ],
                                "description": "pending: will be tried again at nextAttemptAt. failed: no 2xx within 24 hours."
                              },
                              "tries": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991,
                                "description": "How many times it has been sent so far."
                              },
                              "lastStatus": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ],
                                "description": "Your endpoint’s HTTP status on the last try."
                              },
                              "lastError": {
                                "description": "Why the last try did not count as delivered.",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                              },
                              "nextAttemptAt": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "eventId",
                              "type",
                              "status",
                              "tries",
                              "lastStatus",
                              "lastError",
                              "createdAt",
                              "nextAttemptAt"
                            ],
                            "additionalProperties": false
                          },
                          "description": "Its latest deliveries, newest first, kept 30 days after they settle."
                        },
                        "secret": {
                          "type": "string",
                          "description": "Verifies Pubrivo-Signature. Shown once, here."
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "createdAt",
                        "recentDeliveries",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/{id}": {
      "delete": {
        "summary": "Delete a webhook",
        "description": "Stop sending to it. Deliveries still waiting are dropped.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "webhooks:manage",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "description": "An error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "blockers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channelId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "code": {
                                "type": "string",
                                "description": "incomplete: something is missing; problem: something is wrong."
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "upgrade": {
                          "description": "The Plan that raises this limit when one can be bought — or, while a Downgrade is pending, the Plan being kept.",
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "limit": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string",
                              "description": "The way out, worded — “Business holds 5 people”."
                            }
                          },
                          "required": [
                            "plan",
                            "limit",
                            "label"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  }
}
