{
  "openapi": "3.1.0",
  "info": {
    "title": "Content Studio API",
    "version": "1.0.0",
    "description": "Facebook and Instagram social media management. The dashboard and the public API share these endpoints (rules.md §7)."
  },
  "servers": [
    {
      "url": "http://localhost:4000"
    }
  ],
  "components": {
    "securitySchemes": {
      "sessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "cs_at"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    },
    {
      "sessionCookie": []
    },
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v1/auth/register": {
      "post": {
        "summary": "Create an account",
        "description": "Sends a confirmation email. No workspace exists until the email is confirmed.",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_register",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 200
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "email",
                  "password",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "userId": {
                          "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)$"
                        },
                        "verificationToken": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "userId"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/verify-email": {
      "post": {
        "summary": "Confirm an email address",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_verifyEmail",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 16
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "verified": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "verified"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login": {
      "post": {
        "summary": "Sign in",
        "description": "Returns an access token and sets httpOnly session cookies. Responds with TOTP_REQUIRED when two-factor is on.",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_login",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 1
                  },
                  "totpCode": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "user": {
                          "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)$"
                            },
                            "email": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "emailVerified": {
                              "type": "boolean"
                            },
                            "totpEnabled": {
                              "type": "boolean"
                            },
                            "isPlatformAdmin": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "email",
                            "name",
                            "emailVerified",
                            "totpEnabled",
                            "isPlatformAdmin"
                          ],
                          "additionalProperties": false
                        },
                        "accessToken": {
                          "type": "string"
                        },
                        "expiresIn": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "user",
                        "accessToken",
                        "expiresIn"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "summary": "Rotate the session",
        "description": "Reads the refresh cookie. Replaying a rotated token revokes the whole family.",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_refresh",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "user": {
                          "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)$"
                            },
                            "email": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "emailVerified": {
                              "type": "boolean"
                            },
                            "totpEnabled": {
                              "type": "boolean"
                            },
                            "isPlatformAdmin": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "email",
                            "name",
                            "emailVerified",
                            "totpEnabled",
                            "isPlatformAdmin"
                          ],
                          "additionalProperties": false
                        },
                        "accessToken": {
                          "type": "string"
                        },
                        "expiresIn": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "user",
                        "accessToken",
                        "expiresIn"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "summary": "Sign out",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_logout",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/me": {
      "get": {
        "summary": "The signed-in user",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_me",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "emailVerified": {
                          "type": "boolean"
                        },
                        "totpEnabled": {
                          "type": "boolean"
                        },
                        "isPlatformAdmin": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "emailVerified",
                        "totpEnabled",
                        "isPlatformAdmin"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/password": {
      "post": {
        "summary": "Change password",
        "description": "Revokes every other session.",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_changePassword",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "currentPassword": {
                    "type": "string",
                    "minLength": 1
                  },
                  "newPassword": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 200
                  }
                },
                "required": [
                  "currentPassword",
                  "newPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/totp/setup": {
      "post": {
        "summary": "Begin two-factor setup",
        "description": "Stores the secret but does not enable it until a valid code is supplied.",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_beginTotp",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "secret": {
                          "type": "string"
                        },
                        "uri": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "secret",
                        "uri"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/totp/enable": {
      "post": {
        "summary": "Enable two-factor",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_enableTotp",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/totp/disable": {
      "post": {
        "summary": "Disable two-factor",
        "tags": [
          "auth"
        ],
        "operationId": "Auth_disableTotp",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "post": {
        "summary": "Create a workspace",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_create",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "timezone": {
                    "default": "UTC",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "firstDayOfWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timezone",
                        "firstDayOfWeek",
                        "logoUrl",
                        "role",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List the workspaces you belong to",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_list",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "firstDayOfWeek": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "OWNER",
                              "ADMIN",
                              "APPROVER",
                              "COLLABORATOR"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "timezone",
                          "firstDayOfWeek",
                          "logoUrl",
                          "role",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}": {
      "get": {
        "summary": "Read one workspace",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_get",
        "x-public-api": true,
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "firstDayOfWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timezone",
                        "firstDayOfWeek",
                        "logoUrl",
                        "role",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update workspace settings",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_update",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "firstDayOfWeek": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6
                  },
                  "logoUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "firstDayOfWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timezone",
                        "firstDayOfWeek",
                        "logoUrl",
                        "role",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/logo": {
      "put": {
        "summary": "Set the workspace logo",
        "description": "Takes a media id from the library, so a logo goes through the same validation as any other file.",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_setLogo",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "mediaId": {
                    "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": [
                  "mediaId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "firstDayOfWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timezone",
                        "firstDayOfWeek",
                        "logoUrl",
                        "role",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove the workspace logo",
        "tags": [
          "workspaces"
        ],
        "operationId": "Workspaces_clearLogo",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "firstDayOfWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timezone",
                        "firstDayOfWeek",
                        "logoUrl",
                        "role",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/members": {
      "get": {
        "summary": "List workspace members",
        "tags": [
          "members"
        ],
        "operationId": "Members_list",
        "x-public-api": true,
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "userId": {
                            "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)$"
                          },
                          "email": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "OWNER",
                              "ADMIN",
                              "APPROVER",
                              "COLLABORATOR"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "INVITED",
                              "ACTIVE",
                              "SUSPENDED"
                            ]
                          },
                          "joinedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "userId",
                          "email",
                          "name",
                          "role",
                          "status",
                          "joinedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Invite someone by email",
        "tags": [
          "members"
        ],
        "operationId": "Members_invite",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "ADMIN",
                      "APPROVER",
                      "COLLABORATOR"
                    ]
                  }
                },
                "required": [
                  "email",
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "invited": {
                          "type": "boolean",
                          "const": true
                        },
                        "verificationRequired": {
                          "type": "boolean"
                        },
                        "invitationToken": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "invited",
                        "verificationRequired"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/members/{memberId}": {
      "patch": {
        "summary": "Change a member's role",
        "tags": [
          "members"
        ],
        "operationId": "Members_changeRole",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "OWNER",
                      "ADMIN",
                      "APPROVER",
                      "COLLABORATOR"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove a member",
        "tags": [
          "members"
        ],
        "operationId": "Members_remove",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/accept": {
      "post": {
        "summary": "Accept a workspace invitation",
        "tags": [
          "members"
        ],
        "operationId": "Invitations_accept",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 16
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "workspaceId": {
                          "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)$"
                        },
                        "role": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "workspaceId",
                        "role"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts": {
      "get": {
        "summary": "List connected Facebook and Instagram accounts",
        "description": "Includes token health and the capabilities each account actually has, derived from the scopes Meta granted.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_list",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "platform": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK",
                              "INSTAGRAM"
                            ]
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK_PAGE",
                              "INSTAGRAM_BUSINESS"
                            ]
                          },
                          "metaId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "username": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pictureUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "authPath": {
                            "type": "string",
                            "enum": [
                              "UNIFIED_LOGIN",
                              "FACEBOOK_LOGIN",
                              "INSTAGRAM_LOGIN"
                            ]
                          },
                          "grantedScopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "tokenStatus": {
                            "type": "string",
                            "enum": [
                              "VALID",
                              "EXPIRING",
                              "EXPIRED",
                              "PERMISSION_LOST"
                            ]
                          },
                          "tokenExpiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastHealthCheckAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastHealthDetail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "linkedPageMetaId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "platform",
                          "kind",
                          "metaId",
                          "name",
                          "username",
                          "pictureUrl",
                          "authPath",
                          "grantedScopes",
                          "capabilities",
                          "tokenStatus",
                          "tokenExpiresAt",
                          "lastHealthCheckAt",
                          "lastHealthDetail",
                          "linkedPageMetaId",
                          "connectedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts/connect": {
      "post": {
        "summary": "Begin connecting a Meta account",
        "description": "Returns an authorization URL to send the user to. Instagram Login needs no Facebook Page; Facebook Login is required for Pages, Ads and competitor discovery.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_startConnect",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "authPath": {
                    "type": "string",
                    "enum": [
                      "UNIFIED_LOGIN",
                      "FACEBOOK_LOGIN",
                      "INSTAGRAM_LOGIN"
                    ]
                  }
                },
                "required": [
                  "authPath"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "authorizeUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "authorizeUrl",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts/connect/pending": {
      "get": {
        "summary": "A connect this workspace started and has not finished",
        "description": "Null when there is none. Lets the accounts page offer to finish a connect whose URL has been lost to a refresh.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_pendingConnectSession",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "anyOf": [
                        {
                          "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)$"
                            },
                            "authPath": {
                              "type": "string",
                              "enum": [
                                "UNIFIED_LOGIN",
                                "FACEBOOK_LOGIN",
                                "INSTAGRAM_LOGIN"
                              ]
                            },
                            "grantedScopes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "candidates": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "platform": {
                                    "type": "string",
                                    "enum": [
                                      "FACEBOOK",
                                      "INSTAGRAM"
                                    ]
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "FACEBOOK_PAGE",
                                      "INSTAGRAM_BUSINESS"
                                    ]
                                  },
                                  "metaId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "username": {
                                    "type": "string"
                                  },
                                  "pictureUrl": {
                                    "type": "string"
                                  },
                                  "linkedPageMetaId": {
                                    "type": "string"
                                  },
                                  "ineligibleReason": {
                                    "type": "string"
                                  },
                                  "alreadyConnected": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "platform",
                                  "kind",
                                  "metaId",
                                  "name",
                                  "alreadyConnected"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "expiresAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "authPath",
                            "grantedScopes",
                            "candidates",
                            "expiresAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts/connect/{sessionId}": {
      "get": {
        "summary": "The accounts Meta offered, for the user to choose from",
        "description": "Ineligible accounts are returned with the reason, so the UI can explain rather than hide them.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_getConnectSession",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "authPath": {
                          "type": "string",
                          "enum": [
                            "UNIFIED_LOGIN",
                            "FACEBOOK_LOGIN",
                            "INSTAGRAM_LOGIN"
                          ]
                        },
                        "grantedScopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "candidates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "platform": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK",
                                  "INSTAGRAM"
                                ]
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_PAGE",
                                  "INSTAGRAM_BUSINESS"
                                ]
                              },
                              "metaId": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "pictureUrl": {
                                "type": "string"
                              },
                              "linkedPageMetaId": {
                                "type": "string"
                              },
                              "ineligibleReason": {
                                "type": "string"
                              },
                              "alreadyConnected": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "platform",
                              "kind",
                              "metaId",
                              "name",
                              "alreadyConnected"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "authPath",
                        "grantedScopes",
                        "candidates",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Connect the chosen accounts",
        "description": "Reconnecting an account Meta already knows restores the existing record, keeping its history.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_selectAccounts",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "metaIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "metaIds"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "platform": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK",
                              "INSTAGRAM"
                            ]
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK_PAGE",
                              "INSTAGRAM_BUSINESS"
                            ]
                          },
                          "metaId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "username": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pictureUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "authPath": {
                            "type": "string",
                            "enum": [
                              "UNIFIED_LOGIN",
                              "FACEBOOK_LOGIN",
                              "INSTAGRAM_LOGIN"
                            ]
                          },
                          "grantedScopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "tokenStatus": {
                            "type": "string",
                            "enum": [
                              "VALID",
                              "EXPIRING",
                              "EXPIRED",
                              "PERMISSION_LOST"
                            ]
                          },
                          "tokenExpiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastHealthCheckAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastHealthDetail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "linkedPageMetaId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "connectedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "platform",
                          "kind",
                          "metaId",
                          "name",
                          "username",
                          "pictureUrl",
                          "authPath",
                          "grantedScopes",
                          "capabilities",
                          "tokenStatus",
                          "tokenExpiresAt",
                          "lastHealthCheckAt",
                          "lastHealthDetail",
                          "linkedPageMetaId",
                          "connectedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts/{accountId}/health-check": {
      "post": {
        "summary": "Check this account’s Meta access now",
        "description": "An inconclusive result (Meta throttling or an outage) leaves the stored status unchanged rather than marking the account broken.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_healthCheck",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "FACEBOOK",
                            "INSTAGRAM"
                          ]
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "FACEBOOK_PAGE",
                            "INSTAGRAM_BUSINESS"
                          ]
                        },
                        "metaId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "username": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pictureUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "authPath": {
                          "type": "string",
                          "enum": [
                            "UNIFIED_LOGIN",
                            "FACEBOOK_LOGIN",
                            "INSTAGRAM_LOGIN"
                          ]
                        },
                        "grantedScopes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "capabilities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tokenStatus": {
                          "type": "string",
                          "enum": [
                            "VALID",
                            "EXPIRING",
                            "EXPIRED",
                            "PERMISSION_LOST"
                          ]
                        },
                        "tokenExpiresAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastHealthCheckAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastHealthDetail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "linkedPageMetaId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "connectedAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "platform",
                        "kind",
                        "metaId",
                        "name",
                        "username",
                        "pictureUrl",
                        "authPath",
                        "grantedScopes",
                        "capabilities",
                        "tokenStatus",
                        "tokenExpiresAt",
                        "lastHealthCheckAt",
                        "lastHealthDetail",
                        "linkedPageMetaId",
                        "connectedAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/social-accounts/{accountId}": {
      "delete": {
        "summary": "Disconnect an account",
        "description": "Keeps the record and its history; it stops being used for work.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "SocialAccounts_disconnect",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/meta/oauth/callback": {
      "get": {
        "summary": "Meta OAuth callback",
        "description": "Browser redirect target for both login paths. Connects outright when Meta offered exactly one usable account; otherwise redirects back to the dashboard with a connect session, or with an error code.",
        "tags": [
          "social-accounts"
        ],
        "operationId": "MetaOAuth_callback",
        "x-public-api": false,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media": {
      "post": {
        "summary": "Start an upload",
        "description": "Returns a short-lived URL the browser uploads to directly; bytes do not pass through this API in production.",
        "tags": [
          "media"
        ],
        "operationId": "Media_createUpload",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "contentType": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 100
                  }
                },
                "required": [
                  "filename",
                  "contentType"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "mediaId": {
                          "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"
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "mediaId",
                        "uploadUrl",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List the media library",
        "description": "Newest first. Search matches the original filename; rejected files are hidden unless asked for.",
        "tags": [
          "media"
        ],
        "operationId": "Media_list",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "AWAITING_UPLOAD",
                              "VALIDATING",
                              "READY",
                              "REJECTED"
                            ]
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "byteSize": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "width": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "height": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "durationSeconds": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "originalFilename": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rejectionReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "folderId": {
                            "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"
                              }
                            ]
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "status",
                          "contentType",
                          "byteSize",
                          "width",
                          "height",
                          "durationSeconds",
                          "originalFilename",
                          "rejectionReason",
                          "folderId",
                          "url",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/{mediaId}/finalize": {
      "post": {
        "summary": "Validate an uploaded file",
        "description": "Identifies the file from its own bytes rather than its name, and refuses anything Meta will not take.",
        "tags": [
          "media"
        ],
        "operationId": "Media_finalize",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "IMAGE",
                            "VIDEO"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "AWAITING_UPLOAD",
                            "VALIDATING",
                            "READY",
                            "REJECTED"
                          ]
                        },
                        "contentType": {
                          "type": "string"
                        },
                        "byteSize": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "width": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "height": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "durationSeconds": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "originalFilename": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "rejectionReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "folderId": {
                          "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"
                            }
                          ]
                        },
                        "url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "kind",
                        "status",
                        "contentType",
                        "byteSize",
                        "width",
                        "height",
                        "durationSeconds",
                        "originalFilename",
                        "rejectionReason",
                        "folderId",
                        "url",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/{mediaId}/metadata": {
      "post": {
        "summary": "Record video duration and dimensions",
        "description": "Supplied by the browser until the transcode worker lands; duration decides whether a Reel is publishable.",
        "tags": [
          "media"
        ],
        "operationId": "Media_setMetadata",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "durationSeconds": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 14400
                  },
                  "width": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "height": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "durationSeconds"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/usage": {
      "get": {
        "summary": "What the workspace is storing, against its limit",
        "tags": [
          "media"
        ],
        "operationId": "Media_usage",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "usedBytes": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "quotaBytes": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "assetCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "rejectedCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "usedBytes",
                        "quotaBytes",
                        "assetCount",
                        "rejectedCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/folders": {
      "get": {
        "summary": "List the library folders",
        "description": "Flat, with the number of files in each. A file is in one folder or in none.",
        "tags": [
          "media"
        ],
        "operationId": "Media_listFolders",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "assetCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "assetCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a folder",
        "tags": [
          "media"
        ],
        "operationId": "Media_createFolder",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "assetCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "assetCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/folders/{folderId}": {
      "delete": {
        "summary": "Delete a folder",
        "description": "The files inside it survive and return to the library root.",
        "tags": [
          "media"
        ],
        "operationId": "Media_deleteFolder",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "folderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/media/folder": {
      "patch": {
        "summary": "Move files into a folder",
        "description": "A null folder moves them back to the library root.",
        "tags": [
          "media"
        ],
        "operationId": "Media_moveToFolder",
        "x-public-api": true,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "mediaIds": {
                    "minItems": 1,
                    "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)$"
                    }
                  },
                  "folderId": {
                    "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"
                      }
                    ]
                  }
                },
                "required": [
                  "mediaIds",
                  "folderId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "moved": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "moved"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/upload": {
      "put": {
        "summary": "Receive an upload (local storage only)",
        "description": "Signed and short-lived. PUT, as object storage signs; POST is accepted for older clients. With S3 the browser uploads to the object store directly.",
        "tags": [
          "media"
        ],
        "operationId": "PublicMedia_upload",
        "x-public-api": false,
        "x-required-scopes": [
          "MEDIA_WRITE"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/media/file": {
      "get": {
        "summary": "Serve a stored file",
        "description": "Signed and short-lived. This is the URL Meta fetches while publishing.",
        "tags": [
          "media"
        ],
        "operationId": "PublicMedia_file",
        "x-public-api": false,
        "x-required-scopes": [
          "MEDIA_READ"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/labels": {
      "get": {
        "summary": "Every label in the workspace",
        "description": "Key–value pairs, sorted by key then value.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_labels",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "key": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "key",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a label, or return the one that already matches",
        "description": "Keys are lower-cased, so \"Market\" and \"market\" are one key.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createLabel",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "key": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "key",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/labels/{labelId}": {
      "delete": {
        "summary": "Remove a label from the workspace",
        "description": "It is detached from every post that carried it.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_deleteLabel",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "labelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/hashtag-sets": {
      "get": {
        "summary": "Saved hashtag sets",
        "description": "Stored without the leading \"#\", capped at the 30 Instagram reads.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_hashtagSets",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "tags"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save a set of hashtags",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createHashtagSet",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "tags"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/hashtag-sets/{setId}": {
      "delete": {
        "summary": "Remove a hashtag set",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_deleteHashtagSet",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "setId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/views": {
      "get": {
        "summary": "Saved planner views",
        "description": "Workspace-wide: an agency’s \"Monday review\" is the same view for everyone.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_views",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "config": {
                            "type": "object",
                            "properties": {
                              "view": {
                                "type": "string",
                                "enum": [
                                  "lanes",
                                  "list",
                                  "feed",
                                  "grid"
                                ]
                              },
                              "zoom": {
                                "type": "string",
                                "enum": [
                                  "day",
                                  "week",
                                  "month"
                                ]
                              },
                              "platform": {
                                "type": "string",
                                "enum": [
                                  "ALL",
                                  "FACEBOOK",
                                  "INSTAGRAM"
                                ]
                              },
                              "compact": {
                                "type": "boolean"
                              },
                              "labelIds": {
                                "maxItems": 20,
                                "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)$"
                                }
                              },
                              "campaignId": {
                                "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"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "view",
                              "zoom",
                              "platform",
                              "compact",
                              "labelIds",
                              "campaignId"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "config"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save the current planner view",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createView",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "config": {
                          "type": "object",
                          "properties": {
                            "view": {
                              "type": "string",
                              "enum": [
                                "lanes",
                                "list",
                                "feed",
                                "grid"
                              ]
                            },
                            "zoom": {
                              "type": "string",
                              "enum": [
                                "day",
                                "week",
                                "month"
                              ]
                            },
                            "platform": {
                              "type": "string",
                              "enum": [
                                "ALL",
                                "FACEBOOK",
                                "INSTAGRAM"
                              ]
                            },
                            "compact": {
                              "type": "boolean"
                            },
                            "labelIds": {
                              "maxItems": 20,
                              "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)$"
                              }
                            },
                            "campaignId": {
                              "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"
                                }
                              ]
                            }
                          },
                          "required": [
                            "view",
                            "zoom",
                            "platform",
                            "compact",
                            "labelIds",
                            "campaignId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "config"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/views/{viewId}": {
      "delete": {
        "summary": "Forget a saved view",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_deleteView",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/campaigns": {
      "get": {
        "summary": "Campaigns, with how many posts each holds",
        "description": "Archived ones are left out unless asked for.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_campaigns",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "goal": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "startsAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endsAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "archivedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "postCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "goal",
                          "startsAt",
                          "endsAt",
                          "archivedAt",
                          "postCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Start a campaign",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createCampaign",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "goal": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "startsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "endsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "goal",
                        "startsAt",
                        "endsAt",
                        "archivedAt",
                        "postCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/campaigns/{campaignId}": {
      "patch": {
        "summary": "Rename, re-date or archive a campaign",
        "description": "Archiving hides it from the pickers; the posts filed under it keep their link.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_updateCampaign",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "goal": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "startsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "endsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "goal",
                        "startsAt",
                        "endsAt",
                        "archivedAt",
                        "postCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/categories": {
      "get": {
        "summary": "Every content category in the workspace",
        "description": "A post belongs to at most one category. Labels remain the place for the questions with several answers.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_categories",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tint": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 6
                          },
                          "postCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "tint",
                          "postCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a content category",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createCategory",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tint": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 6
                        },
                        "postCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "tint",
                        "postCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/categories/{categoryId}": {
      "patch": {
        "summary": "Rename a category or change its tint",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_updateCategory",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tint": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 6
                        },
                        "postCount": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "tint",
                        "postCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a category",
        "description": "The posts filed under it survive and become uncategorised.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_deleteCategory",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/utm-presets": {
      "get": {
        "summary": "Every UTM preset in the workspace",
        "description": "Applied to the links in a caption at compose time, never stored on the post - editing a preset cannot rewrite what already went out.",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_utmPresets",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "medium": {
                            "type": "string"
                          },
                          "campaign": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "term": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "content": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "source",
                          "medium",
                          "campaign",
                          "term",
                          "content"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a UTM preset",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_createUtmPreset",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "medium": {
                          "type": "string"
                        },
                        "campaign": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "term": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "content": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "source",
                        "medium",
                        "campaign",
                        "term",
                        "content"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/utm-presets/{presetId}": {
      "delete": {
        "summary": "Delete a UTM preset",
        "tags": [
          "organise"
        ],
        "operationId": "Organise_deleteUtmPreset",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "presetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/short-links": {
      "get": {
        "summary": "List the workspace’s shortened links",
        "description": "Newest first, with the number of times each has been opened.",
        "tags": [
          "organise"
        ],
        "operationId": "ShortLinks_list",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "code": {
                            "type": "string"
                          },
                          "targetUrl": {
                            "type": "string"
                          },
                          "shortUrl": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lastClickedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "code",
                          "targetUrl",
                          "shortUrl",
                          "clicks",
                          "lastClickedAt",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Shorten a link",
        "tags": [
          "organise"
        ],
        "operationId": "ShortLinks_create",
        "x-public-api": true,
        "x-required-scopes": [
          "ORGANISE_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "targetUrl": {
                    "type": "string",
                    "maxLength": 2000,
                    "format": "uri"
                  }
                },
                "required": [
                  "targetUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "code": {
                          "type": "string"
                        },
                        "targetUrl": {
                          "type": "string"
                        },
                        "shortUrl": {
                          "type": "string"
                        },
                        "clicks": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "lastClickedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "code",
                        "targetUrl",
                        "shortUrl",
                        "clicks",
                        "lastClickedAt",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/s/{code}": {
      "get": {
        "summary": "Follow a shortened link",
        "description": "Counts the click, then redirects. Not part of the public API surface.",
        "tags": [
          "organise"
        ],
        "operationId": "ShortLinkRedirect_follow",
        "x-public-api": false,
        "x-required-scopes": [
          "ORGANISE_READ"
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts": {
      "post": {
        "summary": "Create a post",
        "description": "Validated against each target network before it is stored, so a post that cannot publish is refused now rather than failing in the queue.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_create",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "caption": {
                    "default": "",
                    "type": "string",
                    "maxLength": 63206
                  },
                  "firstComment": {
                    "type": "string",
                    "maxLength": 2200
                  },
                  "mediaIds": {
                    "default": [],
                    "maxItems": 10,
                    "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)$"
                    }
                  },
                  "targets": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "socialAccountId": {
                          "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": [
                            "FACEBOOK_POST",
                            "FACEBOOK_REEL",
                            "INSTAGRAM_FEED",
                            "INSTAGRAM_CAROUSEL",
                            "INSTAGRAM_REEL",
                            "INSTAGRAM_STORY"
                          ]
                        },
                        "captionOverride": {
                          "type": "string",
                          "maxLength": 63206
                        }
                      },
                      "required": [
                        "socialAccountId",
                        "kind"
                      ]
                    }
                  },
                  "scheduledAt": {
                    "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))$"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "labelIds": {
                    "default": [],
                    "maxItems": 20,
                    "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)$"
                    }
                  },
                  "campaignId": {
                    "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"
                      }
                    ]
                  },
                  "categoryId": {
                    "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"
                      }
                    ]
                  }
                },
                "required": [
                  "targets"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "List posts",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_list",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "PENDING_APPROVAL",
                              "APPROVED",
                              "SCHEDULED",
                              "PUBLISHING",
                              "PUBLISHED",
                              "PARTIALLY_FAILED",
                              "FAILED",
                              "CANCELLED"
                            ]
                          },
                          "caption": {
                            "type": "string"
                          },
                          "firstComment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scheduledAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scheduledTz": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "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"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "AWAITING_UPLOAD",
                                    "VALIDATING",
                                    "READY",
                                    "REJECTED"
                                  ]
                                },
                                "contentType": {
                                  "type": "string"
                                },
                                "byteSize": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "width": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "height": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "durationSeconds": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "originalFilename": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "rejectionReason": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "folderId": {
                                  "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"
                                    }
                                  ]
                                },
                                "url": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "createdAt": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "status",
                                "contentType",
                                "byteSize",
                                "width",
                                "height",
                                "durationSeconds",
                                "originalFilename",
                                "rejectionReason",
                                "folderId",
                                "url",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "targets": {
                            "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)$"
                                },
                                "socialAccountId": {
                                  "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)$"
                                },
                                "accountName": {
                                  "type": "string"
                                },
                                "platform": {
                                  "type": "string"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "FACEBOOK_POST",
                                    "FACEBOOK_REEL",
                                    "INSTAGRAM_FEED",
                                    "INSTAGRAM_CAROUSEL",
                                    "INSTAGRAM_REEL",
                                    "INSTAGRAM_STORY"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "DRAFT",
                                    "PENDING_APPROVAL",
                                    "APPROVED",
                                    "SCHEDULED",
                                    "PUBLISHING",
                                    "PUBLISHED",
                                    "FAILED",
                                    "BLOCKED",
                                    "CANCELLED"
                                  ]
                                },
                                "captionOverride": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "scheduledAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "attempts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "metaPostId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "publishedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "failureCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "failureDetail": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "socialAccountId",
                                "accountName",
                                "platform",
                                "kind",
                                "status",
                                "captionOverride",
                                "scheduledAt",
                                "attempts",
                                "metaPostId",
                                "publishedAt",
                                "failureCode",
                                "failureDetail"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "labels": {
                            "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)$"
                                },
                                "key": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "key",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "campaignId": {
                            "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"
                              }
                            ]
                          },
                          "categoryId": {
                            "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"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "status",
                          "caption",
                          "firstComment",
                          "scheduledAt",
                          "scheduledTz",
                          "media",
                          "targets",
                          "labels",
                          "campaignId",
                          "categoryId",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}": {
      "get": {
        "summary": "Read one post",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_get",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Edit a post",
        "description": "Refused once any target has published, because that part is already live.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_update",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "caption": {
                    "type": "string",
                    "maxLength": 63206
                  },
                  "firstComment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mediaIds": {
                    "maxItems": 10,
                    "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)$"
                    }
                  },
                  "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))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "labelIds": {
                    "maxItems": 20,
                    "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)$"
                    }
                  },
                  "campaignId": {
                    "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"
                      }
                    ]
                  },
                  "categoryId": {
                    "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"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/validation": {
      "get": {
        "summary": "What each network thinks of this post",
        "description": "Issues block publishing; warnings do not.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_validate",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "mediaIndex": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "targetId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "warnings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "mediaIndex": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "targetId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "ok",
                        "issues",
                        "warnings"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/schedule": {
      "post": {
        "summary": "Schedule a post",
        "description": "Targets on unhealthy accounts are held as BLOCKED rather than dropped, and surface a reconnect prompt.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_schedule",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "scheduledAt": {
                    "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))$"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "scheduledAt",
                  "timezone"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/publish": {
      "post": {
        "summary": "Publish now",
        "description": "The same path as scheduling, for this instant.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_publishNow",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "timezone": {
                    "default": "UTC",
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/cancel": {
      "post": {
        "summary": "Cancel a post",
        "description": "Targets already published stay published; the rest are cancelled.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_cancel",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/timeline": {
      "get": {
        "summary": "Everything that happened to this post, in order",
        "description": "Derived from the post, its targets and their attempts - not a second copy of those facts.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_timeline",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "CREATED",
                              "SCHEDULED",
                              "ATTEMPTED",
                              "PUBLISHED",
                              "FAILED",
                              "BLOCKED",
                              "CANCELLED"
                            ]
                          },
                          "accountName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "at",
                          "kind",
                          "accountName",
                          "detail"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/targets/{targetId}/attempts": {
      "get": {
        "summary": "Every publish attempt for one target",
        "description": "Oldest first, including attempts a retry replaced. What Meta said, when, and how long it took.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_attempts",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "attempt": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "metaPostId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "errorCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "errorDetail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "durationMs": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "attempt",
                          "outcome",
                          "metaPostId",
                          "errorCode",
                          "errorDetail",
                          "durationMs",
                          "startedAt",
                          "finishedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/targets/{targetId}/retry": {
      "post": {
        "summary": "Requeue one failed target",
        "description": "Independent of its siblings - a partial failure is fixed one account at a time.",
        "tags": [
          "posts"
        ],
        "operationId": "Posts_retry",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PENDING_APPROVAL",
                            "APPROVED",
                            "SCHEDULED",
                            "PUBLISHING",
                            "PUBLISHED",
                            "PARTIALLY_FAILED",
                            "FAILED",
                            "CANCELLED"
                          ]
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scheduledTz": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "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"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "AWAITING_UPLOAD",
                                  "VALIDATING",
                                  "READY",
                                  "REJECTED"
                                ]
                              },
                              "contentType": {
                                "type": "string"
                              },
                              "byteSize": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "width": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "height": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "durationSeconds": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "originalFilename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "rejectionReason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "folderId": {
                                "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"
                                  }
                                ]
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "status",
                              "contentType",
                              "byteSize",
                              "width",
                              "height",
                              "durationSeconds",
                              "originalFilename",
                              "rejectionReason",
                              "folderId",
                              "url",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "targets": {
                          "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)$"
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "accountName": {
                                "type": "string"
                              },
                              "platform": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_POST",
                                  "FACEBOOK_REEL",
                                  "INSTAGRAM_FEED",
                                  "INSTAGRAM_CAROUSEL",
                                  "INSTAGRAM_REEL",
                                  "INSTAGRAM_STORY"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PENDING_APPROVAL",
                                  "APPROVED",
                                  "SCHEDULED",
                                  "PUBLISHING",
                                  "PUBLISHED",
                                  "FAILED",
                                  "BLOCKED",
                                  "CANCELLED"
                                ]
                              },
                              "captionOverride": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "metaPostId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "publishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "socialAccountId",
                              "accountName",
                              "platform",
                              "kind",
                              "status",
                              "captionOverride",
                              "scheduledAt",
                              "attempts",
                              "metaPostId",
                              "publishedAt",
                              "failureCode",
                              "failureDetail"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "labels": {
                          "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)$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "key",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "campaignId": {
                          "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"
                            }
                          ]
                        },
                        "categoryId": {
                          "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"
                            }
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "status",
                        "caption",
                        "firstComment",
                        "scheduledAt",
                        "scheduledTz",
                        "media",
                        "targets",
                        "labels",
                        "campaignId",
                        "categoryId",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/sync": {
      "post": {
        "summary": "Ask for a refresh now instead of waiting for tonight",
        "description": "Queues a sync for every connected account and returns immediately - it does not wait for Meta, and the numbers it refreshes appear once the worker has them. Repeating the request inside a short window is absorbed rather than sent again.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_sync",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "eligible": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "alreadyQueued": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "queued",
                        "eligible",
                        "alreadyQueued"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/metrics": {
      "get": {
        "summary": "Every metric we report, and what each one means",
        "description": "Each entry says whether Meta produced the number or we computed it, and which version of the definition is in force.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_metrics",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "unit": {
                            "type": "string",
                            "enum": [
                              "COUNT",
                              "RATE_BP",
                              "SECONDS"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "PLATFORM",
                              "COMPUTED"
                            ]
                          },
                          "version": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "key",
                          "label",
                          "description",
                          "unit",
                          "source",
                          "version"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/overview": {
      "get": {
        "summary": "Headline numbers, against the same window one period earlier",
        "description": "A lifetime metric is compared by its latest value, never summed - adding a follower count across thirty days would be thirty times too large.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_overview",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "comparedFrom": {
                          "type": "string"
                        },
                        "comparedTo": {
                          "type": "string"
                        },
                        "cards": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "metric": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "unit": {
                                    "type": "string",
                                    "enum": [
                                      "COUNT",
                                      "RATE_BP",
                                      "SECONDS"
                                    ]
                                  },
                                  "source": {
                                    "type": "string",
                                    "enum": [
                                      "PLATFORM",
                                      "COMPUTED"
                                    ]
                                  },
                                  "version": {
                                    "type": "integer",
                                    "exclusiveMinimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "key",
                                  "label",
                                  "description",
                                  "unit",
                                  "source",
                                  "version"
                                ],
                                "additionalProperties": false
                              },
                              "value": {
                                "type": "number"
                              },
                              "previous": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "changeBp": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "metric",
                              "value",
                              "previous",
                              "changeBp"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "historyStartsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "comparedFrom",
                        "comparedTo",
                        "cards",
                        "historyStartsAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/series": {
      "get": {
        "summary": "One metric over time",
        "description": "Several accounts on the same day are one point: the chart is the workspace.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_series",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "COUNT",
                                "RATE_BP",
                                "SECONDS"
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "PLATFORM",
                                "COMPUTED"
                              ]
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "key",
                            "label",
                            "description",
                            "unit",
                            "source",
                            "version"
                          ],
                          "additionalProperties": false
                        },
                        "period": {
                          "type": "string",
                          "enum": [
                            "DAY",
                            "WEEK",
                            "LIFETIME"
                          ]
                        },
                        "points": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "value": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "date",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "previousTotal": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "total": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "metric",
                        "period",
                        "points",
                        "previousTotal",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/best-times": {
      "get": {
        "summary": "When this workspace’s posts have done best",
        "description": "Our own computation over our own history, not a Meta metric. Returns nothing but an explanation when there is too little data to be honest about.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_bestTimes",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "description": {
                              "type": "string"
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "COUNT",
                                "RATE_BP",
                                "SECONDS"
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "PLATFORM",
                                "COMPUTED"
                              ]
                            },
                            "version": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "key",
                            "label",
                            "description",
                            "unit",
                            "source",
                            "version"
                          ],
                          "additionalProperties": false
                        },
                        "slots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "weekday": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 6
                              },
                              "hour": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 23
                              },
                              "averageValue": {
                                "type": "number"
                              },
                              "samples": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "weekday",
                              "hour",
                              "averageValue",
                              "samples"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "enough": {
                          "type": "boolean"
                        },
                        "samples": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "minimumSamples": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "metric",
                        "slots",
                        "enough",
                        "samples",
                        "minimumSamples",
                        "note"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/analytics/top-posts": {
      "get": {
        "summary": "What did best, by one metric",
        "description": "Returns the caption that produced the number, not only the number.",
        "tags": [
          "analytics"
        ],
        "operationId": "Analytics_topPosts",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "postId": {
                            "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)$"
                          },
                          "postTargetId": {
                            "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)$"
                          },
                          "socialAccountId": {
                            "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)$"
                          },
                          "caption": {
                            "type": "string"
                          },
                          "publishedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "postId",
                          "postTargetId",
                          "socialAccountId",
                          "caption",
                          "publishedAt",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/reports": {
      "get": {
        "summary": "List saved reports",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_list",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "metricKeys": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "socialAccountIds": {
                            "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)$"
                            }
                          },
                          "windowDays": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          },
                          "cadence": {
                            "type": "string",
                            "enum": [
                              "NONE",
                              "WEEKLY",
                              "MONTHLY"
                            ]
                          },
                          "recipients": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "shareUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSentAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextSendAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "metricKeys",
                          "socialAccountIds",
                          "windowDays",
                          "cadence",
                          "recipients",
                          "shareUrl",
                          "lastSentAt",
                          "nextSendAt",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save a report",
        "description": "A cadence other than NONE needs at least one recipient - a schedule with nobody to send to is a job that runs and does nothing.",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_create",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "metricKeys": {
                    "minItems": 1,
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "socialAccountIds": {
                    "default": [],
                    "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)$"
                    }
                  },
                  "windowDays": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 7,
                    "maximum": 90
                  },
                  "cadence": {
                    "default": "NONE",
                    "type": "string",
                    "enum": [
                      "NONE",
                      "WEEKLY",
                      "MONTHLY"
                    ]
                  },
                  "recipients": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email",
                      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                    }
                  }
                },
                "required": [
                  "name",
                  "metricKeys"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "metricKeys": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "windowDays": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "cadence": {
                          "type": "string",
                          "enum": [
                            "NONE",
                            "WEEKLY",
                            "MONTHLY"
                          ]
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSentAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nextSendAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "metricKeys",
                        "socialAccountIds",
                        "windowDays",
                        "cadence",
                        "recipients",
                        "shareUrl",
                        "lastSentAt",
                        "nextSendAt",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/reports/{reportId}": {
      "patch": {
        "summary": "Change a saved report",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_update",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "metricKeys": {
                    "minItems": 1,
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "socialAccountIds": {
                    "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)$"
                    }
                  },
                  "windowDays": {
                    "type": "integer",
                    "minimum": 7,
                    "maximum": 90
                  },
                  "cadence": {
                    "type": "string",
                    "enum": [
                      "NONE",
                      "WEEKLY",
                      "MONTHLY"
                    ]
                  },
                  "recipients": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email",
                      "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "metricKeys": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "windowDays": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "cadence": {
                          "type": "string",
                          "enum": [
                            "NONE",
                            "WEEKLY",
                            "MONTHLY"
                          ]
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSentAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nextSendAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "metricKeys",
                        "socialAccountIds",
                        "windowDays",
                        "cadence",
                        "recipients",
                        "shareUrl",
                        "lastSentAt",
                        "nextSendAt",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a saved report",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_remove",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/reports/{reportId}/share": {
      "post": {
        "summary": "Turn the public link on or off",
        "description": "Turning it off clears the token rather than flagging it, so a link already sent to a client dies when you say it dies.",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_share",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "shared": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "shared"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "metricKeys": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "windowDays": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "cadence": {
                          "type": "string",
                          "enum": [
                            "NONE",
                            "WEEKLY",
                            "MONTHLY"
                          ]
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastSentAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nextSendAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "metricKeys",
                        "socialAccountIds",
                        "windowDays",
                        "cadence",
                        "recipients",
                        "shareUrl",
                        "lastSentAt",
                        "nextSendAt",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/reports/{reportId}/pdf": {
      "get": {
        "summary": "Download the report as a PDF",
        "description": "The same document a scheduled send attaches to an email.",
        "tags": [
          "reports"
        ],
        "operationId": "Reports_pdf",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/r/{token}": {
      "get": {
        "summary": "A shared report, as a PDF",
        "description": "Whoever holds the link sees this one report and nothing else.",
        "tags": [
          "reports"
        ],
        "operationId": "PublicReport_shared",
        "x-public-api": false,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/meta/webhooks": {
      "get": {
        "summary": "Meta’s webhook subscription handshake",
        "description": "Echoes hub.challenge when hub.verify_token matches the configured token. Not part of the public API surface.",
        "tags": [
          "inbox"
        ],
        "operationId": "MetaWebhooks_verify",
        "x-public-api": false,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Receive a Meta webhook delivery",
        "description": "Verifies X-Hub-Signature-256 against the raw body before parsing, deduplicates by event key, enqueues, and returns. Never processes inline. Not part of the public API surface.",
        "tags": [
          "inbox"
        ],
        "operationId": "MetaWebhooks_receive",
        "x-public-api": false,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations": {
      "get": {
        "summary": "Conversations in a folder",
        "description": "Cursor-paginated, newest activity first, with every folder’s count so the rail needs no second call. “Mine” and “Others” are relative to whoever is asking.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_list",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "conversations": {
                          "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)$"
                              },
                              "channel": {
                                "type": "string",
                                "enum": [
                                  "FACEBOOK_COMMENT",
                                  "FACEBOOK_MESSAGE",
                                  "INSTAGRAM_COMMENT",
                                  "INSTAGRAM_MESSAGE"
                                ]
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "OPEN",
                                  "DONE",
                                  "ARCHIVED"
                                ]
                              },
                              "socialAccountId": {
                                "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)$"
                              },
                              "socialAccountName": {
                                "type": "string"
                              },
                              "participantName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "participantUsername": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "preview": {
                                "type": "string"
                              },
                              "unreadCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "lastMessageAt": {
                                "type": "string"
                              },
                              "assignedToUserId": {
                                "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"
                                  }
                                ]
                              },
                              "assignedToName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "tags": {
                                "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)$"
                                    },
                                    "name": {
                                      "type": "string"
                                    },
                                    "tint": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name",
                                    "tint"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "noteCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "id",
                              "channel",
                              "state",
                              "socialAccountId",
                              "socialAccountName",
                              "participantName",
                              "participantUsername",
                              "preview",
                              "unreadCount",
                              "lastMessageAt",
                              "assignedToUserId",
                              "assignedToName",
                              "tags",
                              "noteCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "counts": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "enum": [
                              "UNASSIGNED",
                              "MINE",
                              "ASSIGNED",
                              "OTHERS",
                              "DONE",
                              "ARCHIVED",
                              "ALL"
                            ]
                          },
                          "additionalProperties": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "required": [
                            "UNASSIGNED",
                            "MINE",
                            "ASSIGNED",
                            "OTHERS",
                            "DONE",
                            "ARCHIVED",
                            "ALL"
                          ]
                        }
                      },
                      "required": [
                        "conversations",
                        "nextCursor",
                        "counts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}": {
      "get": {
        "summary": "One conversation, with its messages, notes and reply eligibility",
        "description": "The messaging window is computed here so the reply box can explain a closed one instead of failing on send. Notes are returned alongside the messages and are a different kind of record: they have no delivery status and no send path.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_detail",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "FACEBOOK_COMMENT",
                            "FACEBOOK_MESSAGE",
                            "INSTAGRAM_COMMENT",
                            "INSTAGRAM_MESSAGE"
                          ]
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "OPEN",
                            "DONE",
                            "ARCHIVED"
                          ]
                        },
                        "socialAccountId": {
                          "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)$"
                        },
                        "socialAccountName": {
                          "type": "string"
                        },
                        "participantName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "participantUsername": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "preview": {
                          "type": "string"
                        },
                        "unreadCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "lastMessageAt": {
                          "type": "string"
                        },
                        "assignedToUserId": {
                          "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"
                            }
                          ]
                        },
                        "assignedToName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tags": {
                          "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)$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "tint": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "tint"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "noteCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "messages": {
                          "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)$"
                              },
                              "direction": {
                                "type": "string",
                                "enum": [
                                  "INBOUND",
                                  "OUTBOUND"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "RECEIVED",
                                  "QUEUED",
                                  "SENT",
                                  "FAILED"
                                ]
                              },
                              "text": {
                                "type": "string"
                              },
                              "attachments": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "enum": [
                                        "IMAGE",
                                        "VIDEO",
                                        "AUDIO",
                                        "FILE",
                                        "SHARE",
                                        "STORY",
                                        "UNKNOWN"
                                      ]
                                    },
                                    "url": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "url"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "authorName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sentByUserId": {
                                "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"
                                  }
                                ]
                              },
                              "sentByName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "isPrivateReply": {
                                "type": "boolean"
                              },
                              "failureCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "failureDetail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "occurredAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "direction",
                              "status",
                              "text",
                              "attachments",
                              "authorName",
                              "sentByUserId",
                              "sentByName",
                              "isPrivateReply",
                              "failureCode",
                              "failureDetail",
                              "occurredAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "notes": {
                          "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)$"
                              },
                              "body": {
                                "type": "string"
                              },
                              "authorUserId": {
                                "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"
                                  }
                                ]
                              },
                              "authorName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "mentions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "userId": {
                                      "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)$"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "userId",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "body",
                              "authorUserId",
                              "authorName",
                              "mentions",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "window": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "enum": [
                                "NOT_APPLICABLE",
                                "OPEN",
                                "HUMAN_AGENT",
                                "CLOSED",
                                "NO_INBOUND"
                              ]
                            },
                            "canReply": {
                              "type": "boolean"
                            },
                            "requiresHumanAgentTag": {
                              "type": "boolean"
                            },
                            "closesAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "explanation": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "state",
                            "canReply",
                            "requiresHumanAgentTag",
                            "closesAt",
                            "explanation"
                          ],
                          "additionalProperties": false
                        },
                        "metaPostId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postTargetId": {
                          "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"
                            }
                          ]
                        },
                        "messagingToolsEnabled": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "messagingToolsDetail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "channel",
                        "state",
                        "socialAccountId",
                        "socialAccountName",
                        "participantName",
                        "participantUsername",
                        "preview",
                        "unreadCount",
                        "lastMessageAt",
                        "assignedToUserId",
                        "assignedToName",
                        "tags",
                        "noteCount",
                        "messages",
                        "notes",
                        "window",
                        "metaPostId",
                        "postTargetId",
                        "messagingToolsEnabled",
                        "messagingToolsDetail"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/read": {
      "post": {
        "summary": "Clear a conversation’s unread count",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_markRead",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/reply": {
      "post": {
        "summary": "Reply to a customer",
        "description": "Queues the reply and returns immediately - it does not wait for Meta. Refused with an explanation when the messaging window has closed, when the account cannot answer that channel, or when a comment has already had its one private reply.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_reply",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "asPrivateReply": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "message": {
                          "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)$"
                            },
                            "direction": {
                              "type": "string",
                              "enum": [
                                "INBOUND",
                                "OUTBOUND"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "RECEIVED",
                                "QUEUED",
                                "SENT",
                                "FAILED"
                              ]
                            },
                            "text": {
                              "type": "string"
                            },
                            "attachments": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "IMAGE",
                                      "VIDEO",
                                      "AUDIO",
                                      "FILE",
                                      "SHARE",
                                      "STORY",
                                      "UNKNOWN"
                                    ]
                                  },
                                  "url": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "kind",
                                  "url"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "authorName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sentByUserId": {
                              "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"
                                }
                              ]
                            },
                            "sentByName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "isPrivateReply": {
                              "type": "boolean"
                            },
                            "failureCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "failureDetail": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "occurredAt": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "direction",
                            "status",
                            "text",
                            "attachments",
                            "authorName",
                            "sentByUserId",
                            "sentByName",
                            "isPrivateReply",
                            "failureCode",
                            "failureDetail",
                            "occurredAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "message"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/notes": {
      "post": {
        "summary": "Add an internal note",
        "description": "Visible only inside the workspace. A note is a different record from a reply, with no delivery status and nothing that could send it - @mentions are checked against membership rather than taken as given.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_addNote",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "mentionUserIds": {
                    "default": [],
                    "maxItems": 20,
                    "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": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "body": {
                          "type": "string"
                        },
                        "authorUserId": {
                          "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"
                            }
                          ]
                        },
                        "authorName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mentions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "userId": {
                                "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)$"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "userId",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "body",
                        "authorUserId",
                        "authorName",
                        "mentions",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/assignment": {
      "put": {
        "summary": "Assign a conversation, or unassign it",
        "description": "Null unassigns. The assignee must be an active member of this workspace.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_assign",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "assigneeUserId": {
                    "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"
                      }
                    ]
                  }
                },
                "required": [
                  "assigneeUserId"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/state": {
      "put": {
        "summary": "Mark a conversation done, archived, or open again",
        "description": "A customer writing again reopens a thread on its own, so Done is a decision rather than a lock.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_setState",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "OPEN",
                      "DONE",
                      "ARCHIVED"
                    ]
                  }
                },
                "required": [
                  "state"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/conversations/{conversationId}/tags": {
      "put": {
        "summary": "Replace a conversation’s tags",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_setTags",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "tagIds": {
                    "maxItems": 20,
                    "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": [
                  "tagIds"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/mentions": {
      "get": {
        "summary": "Notes that @mention you",
        "description": "Newest first. The conversation each note is about travels with it.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_mentions",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/mentionable": {
      "get": {
        "summary": "Who can be @mentioned in a note",
        "description": "The workspace’s active members, which is the whole list.",
        "tags": [
          "inbox"
        ],
        "operationId": "Inbox_mentionable",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/tags": {
      "get": {
        "summary": "The workspace’s inbox tags",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_listTags",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "tint": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "tint"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a tag, or recolour one that exists",
        "description": "The same name twice is one tag - the second attempt hands back the first.",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_upsertTag",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "tint": {
                    "default": 1,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 6
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tint": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "tint"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/tags/{tagId}": {
      "delete": {
        "summary": "Delete a tag",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_deleteTag",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/saved-replies": {
      "get": {
        "summary": "Saved replies, most used first",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_listSavedReplies",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "usageCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "body",
                          "usageCount",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save a reply for reuse",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_createSavedReply",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "usageCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "body",
                        "usageCount",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/saved-replies/{savedReplyId}": {
      "put": {
        "summary": "Edit a saved reply",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_updateSavedReply",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "savedReplyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a saved reply",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_deleteSavedReply",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "savedReplyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/messaging-tools": {
      "get": {
        "summary": "Whether each account’s messaging actually works",
        "description": "Instagram needs the account’s own “Connected tools” setting switched on before any permission matters, and nothing reports that setting - so this is what a probe found, plus the steps that fix it. Null means it has not been probed yet, which is not the same as off.",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_messagingTools",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "socialAccountId": {
                            "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)$"
                          },
                          "socialAccountName": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "checkedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "steps": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "webhookSubscribedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "carries": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "COMMENTS",
                                "MESSAGES"
                              ]
                            }
                          }
                        },
                        "required": [
                          "socialAccountId",
                          "socialAccountName",
                          "enabled",
                          "checkedAt",
                          "detail",
                          "steps",
                          "webhookSubscribedAt",
                          "carries"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/accounts/{socialAccountId}/subscribe-webhooks": {
      "post": {
        "summary": "Subscribe an account to our webhooks",
        "description": "Without this Meta delivers nothing for the account, however well the app is configured - subscribing the app to a field is not the same as subscribing the account to the app. Connecting or reconnecting does this on its own; this repairs an account connected before that was true.",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_subscribeWebhooks",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "socialAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/inbox/messaging-tools/{socialAccountId}/check": {
      "post": {
        "summary": "Probe an account’s messaging again",
        "description": "Queues the probe and returns - it is a Meta call, and those never happen on a request thread. Repeated presses inside a minute share a job.",
        "tags": [
          "inbox"
        ],
        "operationId": "InboxLibrary_checkMessagingTools",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "socialAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/captions": {
      "post": {
        "summary": "Draft a caption",
        "description": "Spends AI credits from the workspace’s monthly allowance; the response says which stored generation produced it. Refuses with QUOTA_EXCEEDED when the allowance is used up, naming the plan that raises it. The draft is not published - it is returned for a person to use or discard.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_generateCaption",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "brief": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 1000
                  },
                  "references": {
                    "default": [],
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "content": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4000
                        }
                      },
                      "required": [
                        "label",
                        "content"
                      ]
                    }
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  }
                },
                "required": [
                  "brief"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "caption": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "generationId",
                        "caption"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/hashtags": {
      "post": {
        "summary": "Suggest hashtags",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_hashtags",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 4000
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  }
                },
                "required": [
                  "subject"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "generationId",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/polish": {
      "post": {
        "summary": "Improve a caption without changing what it says",
        "description": "Meaning, facts and language are preserved; it will not add a claim, price or date that was not already there.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_polish",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 4000
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  }
                },
                "required": [
                  "subject"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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"
                        }
                      },
                      "required": [
                        "generationId",
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/hooks": {
      "post": {
        "summary": "Write opening lines",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_hooks",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 4000
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  }
                },
                "required": [
                  "subject"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "generationId",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/post-ideas": {
      "post": {
        "summary": "Suggest things to post about",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_postIdeas",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 4000
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  }
                },
                "required": [
                  "subject"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "generationId",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/repurpose": {
      "post": {
        "summary": "Rewrite a post for the other network",
        "description": "The networks differ in ways that matter to the writing - Instagram captions carry no clickable link, Facebook treats hashtags as noise - so the rewrite is told which it is for.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_repurpose",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 4000
                  },
                  "tier": {
                    "default": "default",
                    "type": "string",
                    "enum": [
                      "default",
                      "cheap"
                    ]
                  },
                  "network": {
                    "type": "string",
                    "enum": [
                      "FACEBOOK",
                      "INSTAGRAM"
                    ]
                  }
                },
                "required": [
                  "subject",
                  "network"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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"
                        }
                      },
                      "required": [
                        "generationId",
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/images": {
      "post": {
        "summary": "Generate images",
        "description": "Charged per image, and held at that rate before the call. The images are kept in this workspace’s media library, so the response is media ids rather than provider URLs, which expire.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_generateImages",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2000
                  },
                  "aspectRatio": {
                    "default": "1:1",
                    "type": "string",
                    "enum": [
                      "1:1",
                      "4:5",
                      "9:16",
                      "16:9"
                    ]
                  },
                  "count": {
                    "default": 1,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "mediaIds": {
                          "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": [
                        "generationId",
                        "mediaIds"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/images/remove-background": {
      "post": {
        "summary": "Remove an image’s background",
        "description": "Takes a media asset from this workspace and returns a new one beside it.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_removeBackground",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "sourceMediaId": {
                    "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": [
                  "sourceMediaId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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)$"
                        },
                        "mediaIds": {
                          "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": [
                        "generationId",
                        "mediaIds"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/insights": {
      "post": {
        "summary": "Explain this month’s numbers",
        "description": "Reads our own insights store, never Meta. Answers with nulls and charges nothing when the workspace has no readings for the period - a month with no data is a normal state, not an error.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_summariseInsights",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "generationId": {
                          "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"
                            }
                          ]
                        },
                        "summary": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "generationId",
                        "summary"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ai/credits": {
      "get": {
        "summary": "AI credits used and remaining this month",
        "description": "Held credits are shown apart from spent ones: they belong to generations still running and are released if those fail.",
        "tags": [
          "ai"
        ],
        "operationId": "Ai_credits",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "spent": {
                          "type": "number"
                        },
                        "held": {
                          "type": "number"
                        },
                        "allowance": {
                          "type": "number"
                        },
                        "remaining": {
                          "type": "number"
                        },
                        "planThatLifts": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "spent",
                        "held",
                        "allowance",
                        "remaining",
                        "planThatLifts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/brand": {
      "get": {
        "summary": "The workspace’s brand voice and word lists",
        "description": "Returns empty fields rather than 404 when nothing has been set up yet.",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_profile",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "voice": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "websiteUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "preferredTerms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "avoidedTerms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "voice",
                        "websiteUrl",
                        "preferredTerms",
                        "avoidedTerms"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Save the brand voice and word lists",
        "description": "This text reaches the model as fenced reference data, never as instruction - a brand document cannot tell a generation what to do.",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_saveProfile",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "voice": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "websiteUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300,
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "preferredTerms": {
                    "default": [],
                    "maxItems": 40,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    }
                  },
                  "avoidedTerms": {
                    "default": [],
                    "maxItems": 40,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 60
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "voice": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "websiteUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "preferredTerms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "avoidedTerms": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "voice",
                        "websiteUrl",
                        "preferredTerms",
                        "avoidedTerms"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/brand/documents": {
      "get": {
        "summary": "Documents generations are grounded in",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_documents",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "STYLE",
                              "HELP"
                            ]
                          },
                          "sourceUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "title",
                          "body",
                          "kind",
                          "sourceUrl",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a document",
        "description": "The title becomes the label the model sees, so it should say what this is.",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_addDocument",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20000
                  },
                  "kind": {
                    "default": "STYLE",
                    "type": "string",
                    "enum": [
                      "STYLE",
                      "HELP"
                    ]
                  },
                  "sourceUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300,
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "title": {
                          "type": "string"
                        },
                        "body": {
                          "type": "string"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "STYLE",
                            "HELP"
                          ]
                        },
                        "sourceUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "title",
                        "body",
                        "kind",
                        "sourceUrl",
                        "enabled"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/brand/documents/{id}/enabled": {
      "put": {
        "summary": "Use or stop using a document",
        "description": "Separate from deleting: a document that steers the model badly should stop being used before anyone decides whether to lose it.",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_setEnabled",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/brand/documents/{id}": {
      "delete": {
        "summary": "Delete a document",
        "tags": [
          "brand"
        ],
        "operationId": "Brand_remove",
        "x-public-api": true,
        "x-required-scopes": [
          "AI_GENERATE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/status": {
      "get": {
        "summary": "Whether auto-replies are on, and what is left this month",
        "description": "The allowance counts replies that actually reached someone. A plan with an allowance of zero cannot turn a rule on at all.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_status",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "sentThisMonth": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "allowance": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "remaining": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "planThatLifts": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "enabled",
                        "sentThisMonth",
                        "allowance",
                        "remaining",
                        "planThatLifts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/enabled": {
      "put": {
        "summary": "The workspace kill switch",
        "description": "Read as each queued reply leaves, not when it was queued, so switching this off stops work already in flight rather than only new work. Nothing is deleted and no rule is edited.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_setKillSwitch",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies": {
      "get": {
        "summary": "The workspace’s rules",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_list",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "priority": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "keywords": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "channels": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "FACEBOOK_COMMENT",
                                "FACEBOOK_MESSAGE",
                                "INSTAGRAM_COMMENT",
                                "INSTAGRAM_MESSAGE"
                              ]
                            }
                          },
                          "socialAccountIds": {
                            "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)$"
                            }
                          },
                          "mode": {
                            "type": "string",
                            "enum": [
                              "AI",
                              "FIXED"
                            ]
                          },
                          "fixedBody": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "guidance": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "enabled",
                          "version",
                          "priority",
                          "keywords",
                          "channels",
                          "socialAccountIds",
                          "mode",
                          "fixedBody",
                          "guidance",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Write a rule",
        "description": "Created switched off. A rule must name at least one channel and one account - an empty list answers nothing and is refused rather than saved, because \"answers nothing\" and \"answers everything\" are one typo apart.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_create",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "priority": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999
                  },
                  "keywords": {
                    "default": [],
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 60
                    }
                  },
                  "channels": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "FACEBOOK_COMMENT",
                        "FACEBOOK_MESSAGE",
                        "INSTAGRAM_COMMENT",
                        "INSTAGRAM_MESSAGE"
                      ]
                    }
                  },
                  "socialAccountIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "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)$"
                    }
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "AI",
                      "FIXED"
                    ]
                  },
                  "fixedBody": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "guidance": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "channels",
                  "socialAccountIds",
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "keywords": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK_COMMENT",
                              "FACEBOOK_MESSAGE",
                              "INSTAGRAM_COMMENT",
                              "INSTAGRAM_MESSAGE"
                            ]
                          }
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "AI",
                            "FIXED"
                          ]
                        },
                        "fixedBody": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "guidance": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "enabled",
                        "version",
                        "priority",
                        "keywords",
                        "channels",
                        "socialAccountIds",
                        "mode",
                        "fixedBody",
                        "guidance",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/{id}": {
      "put": {
        "summary": "Rewrite a rule",
        "description": "Switches the rule off and bumps its version. Changing who a rule answers, or what it says, makes it a different rule from the one somebody decided was safe.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_update",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "priority": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999
                  },
                  "keywords": {
                    "default": [],
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 60
                    }
                  },
                  "channels": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "FACEBOOK_COMMENT",
                        "FACEBOOK_MESSAGE",
                        "INSTAGRAM_COMMENT",
                        "INSTAGRAM_MESSAGE"
                      ]
                    }
                  },
                  "socialAccountIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "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)$"
                    }
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "AI",
                      "FIXED"
                    ]
                  },
                  "fixedBody": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "guidance": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "channels",
                  "socialAccountIds",
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "keywords": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "FACEBOOK_COMMENT",
                              "FACEBOOK_MESSAGE",
                              "INSTAGRAM_COMMENT",
                              "INSTAGRAM_MESSAGE"
                            ]
                          }
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "AI",
                            "FIXED"
                          ]
                        },
                        "fixedBody": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "guidance": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "enabled",
                        "version",
                        "priority",
                        "keywords",
                        "channels",
                        "socialAccountIds",
                        "mode",
                        "fixedBody",
                        "guidance",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a rule",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_remove",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/{id}/enabled": {
      "put": {
        "summary": "Turn one rule on or off",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_setEnabled",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/preview": {
      "post": {
        "summary": "Which rule would answer this message",
        "description": "Sends nothing and spends nothing. It also names every other rule that matched, because \"why did that one answer and not mine\" is the question a second rule always produces.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_preview",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "channel": {
                    "type": "string",
                    "enum": [
                      "FACEBOOK_COMMENT",
                      "FACEBOOK_MESSAGE",
                      "INSTAGRAM_COMMENT",
                      "INSTAGRAM_MESSAGE"
                    ]
                  },
                  "socialAccountId": {
                    "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",
                    "minLength": 1,
                    "maxLength": 4000
                  }
                },
                "required": [
                  "channel",
                  "socialAccountId",
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ruleId": {
                          "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"
                            }
                          ]
                        },
                        "ruleName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "alsoMatched": {
                          "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)$"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "ruleId",
                        "ruleName",
                        "alsoMatched"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/auto-replies/activity": {
      "get": {
        "summary": "What the rules have done",
        "description": "One row per inbound message considered, including the ones nothing answered - \"why did nobody reply to this customer\" is the question actually asked in anger.",
        "tags": [
          "auto-replies"
        ],
        "operationId": "AutoReplies_activity",
        "x-public-api": true,
        "x-required-scopes": [
          "INBOX_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "conversationId": {
                            "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)$"
                          },
                          "messageId": {
                            "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)$"
                          },
                          "ruleId": {
                            "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"
                              }
                            ]
                          },
                          "ruleName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ruleVersion": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "SENT",
                              "SKIPPED",
                              "FAILED"
                            ]
                          },
                          "promptVersion": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "generationId": {
                            "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"
                              }
                            ]
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "conversationId",
                          "messageId",
                          "ruleId",
                          "ruleName",
                          "ruleVersion",
                          "outcome",
                          "promptVersion",
                          "generationId",
                          "reason",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/bulk": {
      "post": {
        "summary": "Import a CSV of posts, or judge one without importing",
        "description": "Takes a CSV as text or an .xlsx as base64; a spreadsheet is turned into CSV on the way in, so one set of rules decides what a row means. Every row is judged before any row is written, so a file with mistakes in it imports the good rows and reports the rest by line number rather than stopping halfway. `dryRun` is the preview, and it is the same call - there is no second code path that could judge differently from the one that writes. Rows that would push an Instagram account past its 25-a-day ceiling are refused here rather than at publish time.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_runBulk",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "csv": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000000
                  },
                  "xlsxBase64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 12000000
                  },
                  "dryRun": {
                    "default": true,
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "accepted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "rejected": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "imported": {
                          "type": "boolean"
                        },
                        "scheduled": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "drafted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "heldBack": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "line",
                              "reason"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "line": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "ok": {
                                "type": "boolean"
                              },
                              "errors": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "caption": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "accounts": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "scheduledAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "line",
                              "ok",
                              "errors",
                              "caption",
                              "accounts",
                              "scheduledAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "fatal",
                        "accepted",
                        "rejected",
                        "imported",
                        "scheduled",
                        "drafted",
                        "heldBack",
                        "rows"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/bulk-images": {
      "post": {
        "summary": "Turn uploaded images into drafts with captions",
        "description": "A caption per image, written from this workspace’s brand material and the file name - nothing here can see the picture, and the endpoint does not pretend to. Every post is created as a DRAFT on purpose: a hundred captions about files nobody looked at is a hundred things a person must read before they go out, and scheduling them would make that review optional.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_bulkImages",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "mediaIds": {
                    "minItems": 1,
                    "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)$"
                    }
                  },
                  "socialAccountIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "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)$"
                    }
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "FACEBOOK",
                      "INSTAGRAM"
                    ]
                  }
                },
                "required": [
                  "mediaIds",
                  "socialAccountIds",
                  "platform"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "failed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "mediaId": {
                                "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)$"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mediaId",
                              "reason"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "skipped": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "postIds": {
                          "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": [
                        "created",
                        "failed",
                        "skipped",
                        "postIds"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/pools": {
      "get": {
        "summary": "Evergreen pools",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_listPools",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "minGapDays": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "postsPerWeek": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "socialAccountIds": {
                            "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)$"
                            }
                          },
                          "itemCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "enabled",
                          "minGapDays",
                          "postsPerWeek",
                          "socialAccountIds",
                          "itemCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Start an evergreen pool",
        "description": "Created switched off and empty. The gap between repeats is at least a week: a pool that may send the same post to the same account daily is a fault rather than a setting.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_createPool",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "minGapDays": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 7,
                    "maximum": 365
                  },
                  "postsPerWeek": {
                    "default": 1,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 14
                  },
                  "socialAccountIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "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": [
                  "name",
                  "socialAccountIds"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "minGapDays": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "postsPerWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "itemCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "enabled",
                        "minGapDays",
                        "postsPerWeek",
                        "socialAccountIds",
                        "itemCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/pools/{id}": {
      "put": {
        "summary": "Change a pool",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_updatePool",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "minGapDays": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 7,
                    "maximum": 365
                  },
                  "postsPerWeek": {
                    "default": 1,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 14
                  },
                  "socialAccountIds": {
                    "minItems": 1,
                    "maxItems": 50,
                    "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": [
                  "name",
                  "socialAccountIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "minGapDays": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "postsPerWeek": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "socialAccountIds": {
                          "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)$"
                          }
                        },
                        "itemCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "enabled",
                        "minGapDays",
                        "postsPerWeek",
                        "socialAccountIds",
                        "itemCount"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a pool",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_removePool",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/pools/{id}/enabled": {
      "put": {
        "summary": "Run a pool, or stop it",
        "description": "An empty pool cannot be switched on. It would run on every tick, find nothing, and look like a fault for weeks before anyone noticed it was simply empty.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_setPoolEnabled",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/pools/{id}/items": {
      "get": {
        "summary": "What is in a pool",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_listItems",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "caption": {
                            "type": "string"
                          },
                          "firstComment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mediaAssetIds": {
                            "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)$"
                            }
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "caption",
                          "firstComment",
                          "mediaAssetIds",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add something to a pool",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_addItem",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "caption": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2200
                  },
                  "firstComment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mediaAssetIds": {
                    "default": [],
                    "maxItems": 10,
                    "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": [
                  "caption"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "caption": {
                          "type": "string"
                        },
                        "firstComment": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mediaAssetIds": {
                          "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)$"
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "caption",
                        "firstComment",
                        "mediaAssetIds",
                        "enabled"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/items/{id}": {
      "delete": {
        "summary": "Remove something from a pool",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_removeItem",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/slots": {
      "get": {
        "summary": "The weekly slot grid",
        "description": "Times are a wall clock in the workspace’s zone, so a slot survives a clock change.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_listSlots",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "categoryId": {
                            "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)$"
                          },
                          "weekday": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "minuteOfDay": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "categoryId",
                          "weekday",
                          "minuteOfDay"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a slot to a category",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_addSlot",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "categoryId": {
                    "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)$"
                  },
                  "weekday": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6
                  },
                  "minuteOfDay": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1439
                  }
                },
                "required": [
                  "categoryId",
                  "weekday",
                  "minuteOfDay"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "categoryId": {
                          "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)$"
                        },
                        "weekday": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "minuteOfDay": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "categoryId",
                        "weekday",
                        "minuteOfDay"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/slots/{id}": {
      "delete": {
        "summary": "Remove a slot",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_removeSlot",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/queue/{categoryId}": {
      "get": {
        "summary": "Where the next posts of a category would land",
        "description": "Times already taken are skipped rather than doubled up, so this is the real answer rather than the grid read back.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_queue",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "times": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "times"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/repeats": {
      "get": {
        "summary": "Posts that go out again",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_listRepeats",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "postId": {
                            "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)$"
                          },
                          "caption": {
                            "type": "string"
                          },
                          "everyDays": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "until": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextAt": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "postId",
                          "caption",
                          "everyDays",
                          "until",
                          "nextAt",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/automations/repeats/{postId}": {
      "put": {
        "summary": "Repeat a post on a cadence",
        "description": "The first repeat is counted from the post’s own time rather than from now, so “every 7 days” about a Friday post means next Friday.",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_saveRepeat",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "everyDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "until": {
                    "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))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "everyDays"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "postId": {
                          "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)$"
                        },
                        "caption": {
                          "type": "string"
                        },
                        "everyDays": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "until": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nextAt": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "postId",
                        "caption",
                        "everyDays",
                        "until",
                        "nextAt",
                        "enabled"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Stop repeating a post",
        "tags": [
          "automations"
        ],
        "operationId": "Automations_removeRepeat",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/approval-workflows": {
      "get": {
        "summary": "The workspace’s approval workflows",
        "description": "At most one is switched on: two would let a post be in two processes with different answers.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_listWorkflows",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "levels": {
                            "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)$"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "position": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "requiredApprovals": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "userIds": {
                                  "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)$"
                                  }
                                },
                                "emails": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "position",
                                "requiredApprovals",
                                "userIds",
                                "emails"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "enabled",
                          "levels"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Design a workflow",
        "description": "Levels are passed in turn. Each needs at least one approver, who is either a member or an email address - the second is a client, who is reached through a link and never given an account.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_createWorkflow",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "levels": {
                    "minItems": 1,
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 60
                        },
                        "requiredApprovals": {
                          "default": 1,
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10
                        },
                        "userIds": {
                          "default": [],
                          "maxItems": 20,
                          "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)$"
                          }
                        },
                        "emails": {
                          "default": [],
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 200,
                            "format": "email",
                            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                          }
                        }
                      },
                      "required": [
                        "name"
                      ]
                    }
                  }
                },
                "required": [
                  "name",
                  "levels"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "levels": {
                          "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)$"
                              },
                              "name": {
                                "type": "string"
                              },
                              "position": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "requiredApprovals": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "userIds": {
                                "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)$"
                                }
                              },
                              "emails": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "position",
                              "requiredApprovals",
                              "userIds",
                              "emails"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "enabled",
                        "levels"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/approval-workflows/{id}/active": {
      "put": {
        "summary": "Make this the workflow posts go through",
        "description": "Switches every other one off in the same transaction.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_activate",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/approval-workflows/active": {
      "delete": {
        "summary": "Stop approving posts",
        "description": "Posts can be scheduled directly again. Nothing already decided is undone.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_deactivate",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/approval-workflows/{id}": {
      "delete": {
        "summary": "Delete a workflow",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_removeWorkflow",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/approval": {
      "post": {
        "summary": "Ask for approval",
        "description": "Resubmitting after a rejection starts the whole workflow again from the first level: a post that was changed has not been seen by anyone, including the people who already said yes.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_submit",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "postId": {
                          "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)$"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED"
                          ]
                        },
                        "workflowName": {
                          "type": "string"
                        },
                        "currentLevel": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "levelName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "levelCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "requestedAt": {
                          "type": "string"
                        },
                        "decisions": {
                          "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)$"
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "APPROVE",
                                  "REJECT"
                                ]
                              },
                              "by": {
                                "type": "string"
                              },
                              "comment": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "decidedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "decision",
                              "by",
                              "comment",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "postId",
                        "state",
                        "workflowName",
                        "currentLevel",
                        "levelName",
                        "levelCount",
                        "requestedAt",
                        "decisions"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Where a post has got to",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_getApproval",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "postId": {
                          "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)$"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED"
                          ]
                        },
                        "workflowName": {
                          "type": "string"
                        },
                        "currentLevel": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "levelName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "levelCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "requestedAt": {
                          "type": "string"
                        },
                        "decisions": {
                          "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)$"
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "APPROVE",
                                  "REJECT"
                                ]
                              },
                              "by": {
                                "type": "string"
                              },
                              "comment": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "decidedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "decision",
                              "by",
                              "comment",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "postId",
                        "state",
                        "workflowName",
                        "currentLevel",
                        "levelName",
                        "levelCount",
                        "requestedAt",
                        "decisions"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/approval/decision": {
      "post": {
        "summary": "Approve a post, or send it back",
        "description": "One rejection is final for the round. Tallying them instead would let a post go out over somebody’s explicit objection.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_decide",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "APPROVE",
                      "REJECT"
                    ]
                  },
                  "comment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "postId": {
                          "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)$"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "PENDING",
                            "APPROVED",
                            "REJECTED"
                          ]
                        },
                        "workflowName": {
                          "type": "string"
                        },
                        "currentLevel": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "levelName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "levelCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "requestedAt": {
                          "type": "string"
                        },
                        "decisions": {
                          "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)$"
                              },
                              "decision": {
                                "type": "string",
                                "enum": [
                                  "APPROVE",
                                  "REJECT"
                                ]
                              },
                              "by": {
                                "type": "string"
                              },
                              "comment": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "decidedAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "decision",
                              "by",
                              "comment",
                              "decidedAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "postId",
                        "state",
                        "workflowName",
                        "currentLevel",
                        "levelName",
                        "levelCount",
                        "requestedAt",
                        "decisions"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/approval/invite": {
      "post": {
        "summary": "Make a link for an approver outside the workspace",
        "description": "The raw link is returned once and never stored. It expires, is good for one decision, and reaches one post - the holder gets no session and no workspace.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_invite",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "token": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "token",
                        "expiresAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/posts/{postId}/comments": {
      "get": {
        "summary": "The team’s discussion of a post",
        "description": "Internal. Nothing here can be sent to a customer - it is not a message and has no send path.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_comments",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "body": {
                            "type": "string"
                          },
                          "author": {
                            "type": "string"
                          },
                          "mentionedUserIds": {
                            "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)$"
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "body",
                          "author",
                          "mentionedUserIds",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Say something about a post",
        "description": "Mentions are member ids chosen from a list rather than names parsed from the prose, so a rename does not silently stop telling somebody.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_addComment",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "postId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  },
                  "mentionedUserIds": {
                    "default": [],
                    "maxItems": 20,
                    "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": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "body": {
                          "type": "string"
                        },
                        "author": {
                          "type": "string"
                        },
                        "mentionedUserIds": {
                          "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)$"
                          }
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "body",
                        "author",
                        "mentionedUserIds",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/comments/{id}": {
      "delete": {
        "summary": "Delete a comment",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_removeComment",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/notifications": {
      "get": {
        "summary": "What has happened that you asked to hear about",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_notifications",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "unread": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "items": {
                          "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)$"
                              },
                              "event": {
                                "type": "string",
                                "enum": [
                                  "APPROVAL_REQUESTED",
                                  "APPROVAL_DECIDED",
                                  "POST_PUBLISHED",
                                  "POST_FAILED",
                                  "MENTIONED",
                                  "ACCOUNT_NEEDS_RECONNECT"
                                ]
                              },
                              "title": {
                                "type": "string"
                              },
                              "href": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "readAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "event",
                              "title",
                              "href",
                              "readAt",
                              "createdAt"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "unread",
                        "items"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/notifications/read": {
      "post": {
        "summary": "Mark notifications read",
        "description": "An empty list marks them all read.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_markRead",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ids": {
                    "default": [],
                    "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)$"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/notification-preferences": {
      "get": {
        "summary": "What you have asked to hear about",
        "description": "Every event, defaults included, so a preference nobody has saved reads as its default rather than as off.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_preferences",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event": {
                            "type": "string",
                            "enum": [
                              "APPROVAL_REQUESTED",
                              "APPROVAL_DECIDED",
                              "POST_PUBLISHED",
                              "POST_FAILED",
                              "MENTIONED",
                              "ACCOUNT_NEEDS_RECONNECT"
                            ]
                          },
                          "channels": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "IN_APP",
                                "EMAIL",
                                "BROWSER"
                              ]
                            }
                          },
                          "digest": {
                            "type": "string",
                            "enum": [
                              "IMMEDIATE",
                              "DAILY",
                              "OFF"
                            ]
                          }
                        },
                        "required": [
                          "event",
                          "channels",
                          "digest"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Change what you hear about",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_savePreference",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "APPROVAL_REQUESTED",
                      "APPROVAL_DECIDED",
                      "POST_PUBLISHED",
                      "POST_FAILED",
                      "MENTIONED",
                      "ACCOUNT_NEEDS_RECONNECT"
                    ]
                  },
                  "channels": {
                    "maxItems": 2,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "IN_APP",
                        "EMAIL",
                        "BROWSER"
                      ]
                    }
                  },
                  "digest": {
                    "type": "string",
                    "enum": [
                      "IMMEDIATE",
                      "DAILY",
                      "OFF"
                    ]
                  }
                },
                "required": [
                  "event",
                  "channels",
                  "digest"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/push-devices": {
      "get": {
        "summary": "Browsers you have allowed to notify you",
        "description": "One row per browser, not per person: a laptop and a phone are two, and revoking one must not silence the other.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_pushDevices",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "lastSentAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "createdAt",
                          "lastSentAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Allow this browser to notify you",
        "description": "The keys are the browser’s own, handed over by the Push API - they are not secrets of ours and cannot read anything. Keyed on the endpoint, because a browser re-subscribing hands back the same one and two rows would mean two notifications.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_savePushDevice",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "maxLength": 600,
                    "format": "uri"
                  },
                  "p256dh": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "auth": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "label": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "endpoint",
                  "p256dh",
                  "auth"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/push-devices/{id}": {
      "delete": {
        "summary": "Stop notifying this browser",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_removePushDevice",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/planner.pdf": {
      "get": {
        "summary": "The plan as a PDF",
        "description": "Built from the same rows a shared link shows, so a printed plan and a linked one cannot disagree. Branded like a report, because a plan going to an agency’s client is the agency’s document.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_plannerPdf",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/planner-shares": {
      "get": {
        "summary": "Read-only links to this planner",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_listShares",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "label": {
                            "type": "string"
                          },
                          "daysAhead": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastViewedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "daysAhead",
                          "expiresAt",
                          "revokedAt",
                          "lastViewedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Make a read-only link to the planner",
        "description": "Returned once. It expires and shows a fixed window of days, so a share does not quietly become a standing view of work nobody meant to show.",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_createShare",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "daysAhead": {
                    "default": 28,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120
                  },
                  "expiresInDays": {
                    "default": 30,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "daysAhead": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "revokedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastViewedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "token": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "daysAhead",
                        "expiresAt",
                        "revokedAt",
                        "lastViewedAt",
                        "token"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/planner-shares/{id}": {
      "delete": {
        "summary": "Revoke a link",
        "tags": [
          "approvals"
        ],
        "operationId": "Approvals_revokeShare",
        "x-public-api": true,
        "x-required-scopes": [
          "POSTS_WRITE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/approvals/{token}": {
      "get": {
        "summary": "The one post an approval link is about",
        "description": "Four fields: the caption, when it is due, which stage it is at, and whether it has been decided. No workspace, no accounts, no other posts, no team discussion.",
        "tags": [
          "public"
        ],
        "operationId": "PublicLinks_view",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "caption": {
                          "type": "string"
                        },
                        "scheduledAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "levelName": {
                          "type": "string"
                        },
                        "decided": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "caption",
                        "scheduledAt",
                        "levelName",
                        "decided"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/approvals/{token}/decision": {
      "post": {
        "summary": "Approve that post, or send it back",
        "description": "The link is spent on use. An expired, spent or unknown link is refused with the same answer - telling them apart would let someone learn which links exist - and the attempt is recorded in the workspace’s audit log.",
        "tags": [
          "public"
        ],
        "operationId": "PublicLinks_decide",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "APPROVE",
                      "REJECT"
                    ]
                  },
                  "comment": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "decision"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "settled": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "settled"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/planner/{token}": {
      "get": {
        "summary": "A read-only view of a planner",
        "description": "Captions, times, account names and status, inside the window the link was made with. No ids leave this route, because an id is the beginning of a second request.",
        "tags": [
          "public"
        ],
        "operationId": "PublicLinks_planner",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "posts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "caption": {
                                "type": "string"
                              },
                              "scheduledAt": {
                                "type": "string"
                              },
                              "accounts": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "status": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "caption",
                              "scheduledAt",
                              "accounts",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "label",
                        "posts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ad-accounts": {
      "get": {
        "summary": "Ad accounts this workspace reads",
        "description": "Analytics only. This product has no write path to Meta Ads: it cannot create, edit, pause or spend on a campaign, and the build fails if a call that would is added.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_listAccounts",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "metaAdAccountId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "analyticsOnly": {
                            "type": "boolean"
                          },
                          "sourceAccountName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "metaAdAccountId",
                          "name",
                          "currency",
                          "enabled",
                          "analyticsOnly",
                          "sourceAccountName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ad-accounts/{id}/enabled": {
      "put": {
        "summary": "Sync an ad account, or stop",
        "description": "Stopping leaves the figures already collected in place.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_setEnabled",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ad-accounts/{id}": {
      "delete": {
        "summary": "Forget an ad account",
        "description": "Removes our copy of its figures. Nothing in Meta Ads is touched.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_removeAccount",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/ad-accounts/{id}/report": {
      "get": {
        "summary": "Spend and results for a window",
        "description": "From our own store, so it costs no quota and keeps history after Meta drops it. Reach is the largest day rather than a sum - the same person reached twice is one person.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_report",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string"
                        },
                        "level": {
                          "type": "string",
                          "enum": [
                            "ACCOUNT",
                            "CAMPAIGN",
                            "ADSET",
                            "AD"
                          ]
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "totals": {
                          "type": "object",
                          "properties": {
                            "objectId": {
                              "type": "string"
                            },
                            "objectName": {
                              "type": "string"
                            },
                            "spend": {
                              "type": "number"
                            },
                            "impressions": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "reach": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "clicks": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "results": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "resultType": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "cpm": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "cpc": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "ctr": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "costPerResult": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "objectId",
                            "objectName",
                            "spend",
                            "impressions",
                            "reach",
                            "clicks",
                            "results",
                            "resultType",
                            "cpm",
                            "cpc",
                            "ctr",
                            "costPerResult"
                          ],
                          "additionalProperties": false
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "objectId": {
                                "type": "string"
                              },
                              "objectName": {
                                "type": "string"
                              },
                              "spend": {
                                "type": "number"
                              },
                              "impressions": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "reach": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "clicks": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "results": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "resultType": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "cpm": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "cpc": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "ctr": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "costPerResult": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "objectId",
                              "objectName",
                              "spend",
                              "impressions",
                              "reach",
                              "clicks",
                              "results",
                              "resultType",
                              "cpm",
                              "cpc",
                              "ctr",
                              "costPerResult"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "series": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "spend": {
                                "type": "number"
                              },
                              "results": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "date",
                              "spend",
                              "results"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "currency",
                        "level",
                        "from",
                        "to",
                        "totals",
                        "rows",
                        "series"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/competitors/availability": {
      "get": {
        "summary": "Whether this workspace can watch competitors",
        "description": "Answered with a reason rather than a boolean. An Instagram-Login connection can never do this; a Facebook-Login one missing a permission could after a reconnect, and those are different things to tell somebody.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_availability",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "available": {
                          "type": "boolean"
                        },
                        "explanation": {
                          "type": "string"
                        },
                        "eligibleAccountIds": {
                          "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": [
                        "available",
                        "explanation",
                        "eligibleAccountIds"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/competitors": {
      "get": {
        "summary": "The accounts being watched",
        "description": "Public business profiles, read once a day through one of your own accounts.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_listCompetitors",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "username": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "followers": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "followerChange": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "postsLast7": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "engagement": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastReadAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "topMedia": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "caption": {
                                  "type": "string"
                                },
                                "likes": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "comments": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "permalink": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "caption",
                                "likes",
                                "comments",
                                "permalink"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "username",
                          "displayName",
                          "followers",
                          "followerChange",
                          "postsLast7",
                          "engagement",
                          "lastReadAt",
                          "topMedia"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Watch an account",
        "description": "Five at most - each one is a call a day against your own account’s quota.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_addCompetitor",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "socialAccountId": {
                    "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)$"
                  },
                  "username": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60,
                    "pattern": "^@?[A-Za-z0-9._]+$"
                  }
                },
                "required": [
                  "socialAccountId",
                  "username"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/competitors/{id}": {
      "delete": {
        "summary": "Stop watching an account",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_removeCompetitor",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/hashtag-window/{socialAccountId}": {
      "get": {
        "summary": "What is left of this account’s hashtag searches",
        "description": "Instagram allows 30 unique hashtags per account per rolling seven days and offers no endpoint for what is left, so this is counted on our side. It exists so the number can be shown before it is spent rather than after the thirty-first search fails.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_window",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "socialAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "remaining": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limit": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "resetsAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "inWindow": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "used",
                        "remaining",
                        "limit",
                        "resetsAt",
                        "inWindow"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/hashtag-search": {
      "post": {
        "summary": "Top posts for a hashtag",
        "description": "Spends one of the thirty for a hashtag not already inside the window; a repeat is free, which is Instagram’s rule rather than ours. Refused with the date the next one returns when the window is spent.",
        "tags": [
          "ads"
        ],
        "operationId": "Ads_search",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "socialAccountId": {
                    "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)$"
                  },
                  "hashtag": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "pattern": "^#?[A-Za-z0-9_]+$"
                  }
                },
                "required": [
                  "socialAccountId",
                  "hashtag"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "hashtag": {
                          "type": "string"
                        },
                        "spentOne": {
                          "type": "boolean"
                        },
                        "window": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "remaining": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "limit": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "resetsAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "inWindow": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "used",
                            "remaining",
                            "limit",
                            "resetsAt",
                            "inWindow"
                          ],
                          "additionalProperties": false
                        },
                        "posts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "caption": {
                                "type": "string"
                              },
                              "likes": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "comments": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "permalink": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "caption",
                              "likes",
                              "comments",
                              "permalink"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "hashtag",
                        "spentOne",
                        "window",
                        "posts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/easy-connect": {
      "get": {
        "summary": "Links clients can connect accounts through",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_listLinks",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "label": {
                            "type": "string"
                          },
                          "maxUses": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "usedCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "maxUses",
                          "usedCount",
                          "expiresAt",
                          "revokedAt",
                          "lastUsedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Make a link for a client",
        "description": "Returned once. It expires, is good for a fixed number of accounts, and grants exactly one capability - starting Meta’s consent against this workspace. It carries no session and reads nothing.",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_createLink",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "maxUses": {
                    "default": 3,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10
                  },
                  "expiresInDays": {
                    "default": 7,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "label": {
                          "type": "string"
                        },
                        "maxUses": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "usedCount": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "expiresAt": {
                          "type": "string"
                        },
                        "revokedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "lastUsedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "token": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "maxUses",
                        "usedCount",
                        "expiresAt",
                        "revokedAt",
                        "lastUsedAt",
                        "token"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/easy-connect/{id}": {
      "delete": {
        "summary": "Revoke a link",
        "description": "Accounts already connected through it stay connected.",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_revokeLink",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/branding": {
      "get": {
        "summary": "What clients see instead of our name",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_branding",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "companyName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoMediaId": {
                          "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"
                            }
                          ]
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "accentColor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "hideProductBranding": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "companyName",
                        "logoMediaId",
                        "logoUrl",
                        "accentColor",
                        "hideProductBranding"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "Set a company name, logo and colour",
        "description": "The logo is a media id already in this workspace’s library rather than a URL, so a file enters this product by one path only. Every change is audit-logged.",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_saveBranding",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "companyName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "logoMediaId": {
                    "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"
                      }
                    ]
                  },
                  "accentColor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hideProductBranding": {
                    "default": false,
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "companyName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "logoMediaId": {
                          "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"
                            }
                          ]
                        },
                        "logoUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "accentColor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "hideProductBranding": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "companyName",
                        "logoMediaId",
                        "logoUrl",
                        "accentColor",
                        "hideProductBranding"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/audit-log": {
      "get": {
        "summary": "What has been done in this workspace",
        "description": "Already recorded; this is somewhere to read it. An audit trail nobody can see is a compliance checkbox rather than a control.",
        "tags": [
          "agency"
        ],
        "operationId": "Agency_auditLog",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "action": {
                            "type": "string"
                          },
                          "actor": {
                            "type": "string"
                          },
                          "targetType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "targetId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "metadata": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "action",
                          "actor",
                          "targetType",
                          "targetId",
                          "metadata",
                          "at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/easy-connect/{token}": {
      "get": {
        "summary": "Who is asking, and whether the link still works",
        "description": "Three fields. Not the workspace id, not the accounts already connected, not who else holds a link - only enough to know you are in the right place before handing Meta your credentials.",
        "tags": [
          "public"
        ],
        "operationId": "EasyConnect_invite",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "invitedBy": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "remainingUses": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "invitedBy",
                        "label",
                        "remainingUses"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/easy-connect/{token}/start": {
      "get": {
        "summary": "Send the client to Meta’s consent screen",
        "description": "Redirects. The workspace comes from the link rather than from a session, and the OAuth state row carries it through the callback.",
        "tags": [
          "public"
        ],
        "operationId": "EasyConnect_start",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {},
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/easy-connect/{token}/claim": {
      "post": {
        "summary": "Spend one use and begin connecting",
        "description": "The use is spent before Meta is involved, conditionally, so two people opening the same link at the same second cannot both take the last one. An expired, revoked or spent link is refused and the attempt is recorded in the workspace’s audit log.",
        "tags": [
          "public"
        ],
        "operationId": "EasyConnect_claim",
        "x-public-api": true,
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "workspaceId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "workspaceId"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/plan": {
      "get": {
        "summary": "The plan, what it allows, and what is being used",
        "description": "Limits and usage in one answer, because every screen that asks for one asks for the other and two calls would let them disagree by a request. A workspace over a ceiling is told what it cannot add - nothing is ever removed or hidden (§23).",
        "tags": [
          "billing"
        ],
        "operationId": "Plan_status",
        "x-public-api": true,
        "x-required-scopes": [
          "ACCOUNTS_READ"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "subscription": {
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string",
                              "enum": [
                                "FREE",
                                "STARTER",
                                "GROWTH",
                                "SCALE"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "ACTIVE",
                                "TRIALING",
                                "PAST_DUE",
                                "CANCELED"
                              ]
                            },
                            "periodEnd": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "cancelAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "addOns": {
                              "type": "object",
                              "properties": {
                                "extraAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "extraMembers": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "extraWorkspaces": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "extraAiCredits": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "extraAccounts",
                                "extraMembers",
                                "extraWorkspaces",
                                "extraAiCredits"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "plan",
                            "status",
                            "periodEnd",
                            "cancelAt",
                            "addOns"
                          ],
                          "additionalProperties": false
                        },
                        "limits": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "used": {
                                "type": "number"
                              },
                              "limit": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "over": {
                                "type": "boolean"
                              },
                              "planThatLifts": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "key",
                              "label",
                              "used",
                              "limit",
                              "over",
                              "planThatLifts"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "lockedExplanation": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "subscription",
                        "limits",
                        "lockedExplanation"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/webhook": {
      "post": {
        "summary": "Receive a billing event",
        "description": "Verified against the raw body before it is parsed. Claimed by the provider’s event id before it is applied, so a retry adds nothing; applied only if it is newer than the last event, because providers deliver out of order and a delayed “created” after a “cancelled” would put a workspace back on a plan it does not pay for.",
        "tags": [
          "billing"
        ],
        "operationId": "BillingWebhook_receive",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "occurredAt": {
                    "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))$"
                  },
                  "workspaceId": {
                    "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)$"
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "FREE",
                      "STARTER",
                      "GROWTH",
                      "SCALE"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "ACTIVE",
                      "TRIALING",
                      "PAST_DUE",
                      "CANCELED"
                    ]
                  },
                  "providerCustomerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "providerSubscriptionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "periodStart": {
                    "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))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "periodEnd": {
                    "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))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cancelAt": {
                    "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))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addOns": {
                    "default": {
                      "extraAccounts": 0,
                      "extraMembers": 0,
                      "extraWorkspaces": 0,
                      "extraAiCredits": 0
                    },
                    "type": "object",
                    "properties": {
                      "extraAccounts": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000
                      },
                      "extraMembers": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000
                      },
                      "extraWorkspaces": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "extraAiCredits": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000
                      }
                    }
                  }
                },
                "required": [
                  "eventId",
                  "type",
                  "occurredAt",
                  "workspaceId",
                  "plan",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "applied": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "applied"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/model-routes": {
      "get": {
        "summary": "Every model route, enabled or not",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_list",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "capability": {
                            "type": "string",
                            "enum": [
                              "text.generate",
                              "text.classify",
                              "image.generate",
                              "image.edit",
                              "image.upscale",
                              "image.remove-background",
                              "video.text-to-video",
                              "video.image-to-video",
                              "speech.transcribe"
                            ]
                          },
                          "tier": {
                            "type": "string",
                            "enum": [
                              "default",
                              "premium",
                              "cheap"
                            ]
                          },
                          "provider": {
                            "type": "string"
                          },
                          "modelId": {
                            "type": "string"
                          },
                          "params": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "costPerUnit": {
                            "type": "number"
                          },
                          "priority": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "features": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "textRendering",
                                "referenceImages",
                                "inpainting",
                                "audio"
                              ]
                            }
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "workspaceId": {
                            "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"
                              }
                            ]
                          },
                          "plan": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "capability",
                          "tier",
                          "provider",
                          "modelId",
                          "params",
                          "costPerUnit",
                          "priority",
                          "enabled",
                          "features",
                          "version",
                          "workspaceId",
                          "plan"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a model route",
        "description": "Created disabled, always: §36.10 makes going live a deliberate act, so a new route serves nothing until it is enabled.",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_create",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "capability": {
                    "type": "string",
                    "enum": [
                      "text.generate",
                      "text.classify",
                      "image.generate",
                      "image.edit",
                      "image.upscale",
                      "image.remove-background",
                      "video.text-to-video",
                      "video.image-to-video",
                      "speech.transcribe"
                    ]
                  },
                  "tier": {
                    "type": "string",
                    "enum": [
                      "default",
                      "premium",
                      "cheap"
                    ]
                  },
                  "provider": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "params": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "costPerUnit": {
                    "type": "number",
                    "minimum": 0
                  },
                  "priority": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "features": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "textRendering",
                        "referenceImages",
                        "inpainting",
                        "audio"
                      ]
                    }
                  },
                  "workspaceId": {
                    "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"
                      }
                    ]
                  },
                  "plan": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "FREE",
                          "STARTER",
                          "GROWTH",
                          "SCALE"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "capability",
                  "tier",
                  "provider",
                  "modelId",
                  "costPerUnit"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "capability": {
                          "type": "string",
                          "enum": [
                            "text.generate",
                            "text.classify",
                            "image.generate",
                            "image.edit",
                            "image.upscale",
                            "image.remove-background",
                            "video.text-to-video",
                            "video.image-to-video",
                            "speech.transcribe"
                          ]
                        },
                        "tier": {
                          "type": "string",
                          "enum": [
                            "default",
                            "premium",
                            "cheap"
                          ]
                        },
                        "provider": {
                          "type": "string"
                        },
                        "modelId": {
                          "type": "string"
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "costPerUnit": {
                          "type": "number"
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "textRendering",
                              "referenceImages",
                              "inpainting",
                              "audio"
                            ]
                          }
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "workspaceId": {
                          "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"
                            }
                          ]
                        },
                        "plan": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "capability",
                        "tier",
                        "provider",
                        "modelId",
                        "params",
                        "costPerUnit",
                        "priority",
                        "enabled",
                        "features",
                        "version",
                        "workspaceId",
                        "plan"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/model-routes/{id}": {
      "patch": {
        "summary": "Edit a model route",
        "description": "Takes effect on the next request - no deploy. Capability and scope cannot be changed: that would make it a different route wearing the same id, and a generation naming this version would describe something that no longer exists.",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_update",
        "x-public-api": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "modelId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "params": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "costPerUnit": {
                    "type": "number",
                    "minimum": 0
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "features": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "textRendering",
                        "referenceImages",
                        "inpainting",
                        "audio"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "capability": {
                          "type": "string",
                          "enum": [
                            "text.generate",
                            "text.classify",
                            "image.generate",
                            "image.edit",
                            "image.upscale",
                            "image.remove-background",
                            "video.text-to-video",
                            "video.image-to-video",
                            "speech.transcribe"
                          ]
                        },
                        "tier": {
                          "type": "string",
                          "enum": [
                            "default",
                            "premium",
                            "cheap"
                          ]
                        },
                        "provider": {
                          "type": "string"
                        },
                        "modelId": {
                          "type": "string"
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "costPerUnit": {
                          "type": "number"
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "textRendering",
                              "referenceImages",
                              "inpainting",
                              "audio"
                            ]
                          }
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "workspaceId": {
                          "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"
                            }
                          ]
                        },
                        "plan": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "capability",
                        "tier",
                        "provider",
                        "modelId",
                        "params",
                        "costPerUnit",
                        "priority",
                        "enabled",
                        "features",
                        "version",
                        "workspaceId",
                        "plan"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a model route",
        "description": "Past generations keep naming it: they copied the provider, model and version rather than pointing at this row, so history survives the deletion (§36.7).",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_remove",
        "x-public-api": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/model-routes/{id}/enabled": {
      "put": {
        "summary": "Turn a route on or off",
        "description": "The moment traffic moves, so it is its own action with its own audit entry. Enabling refuses with AI_ROUTE_INCAPABLE when the model lacks a feature the caller said the product needs (§36.8).",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_setEnabled",
        "x-public-api": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "requiredFeatures": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "textRendering",
                        "referenceImages",
                        "inpainting",
                        "audio"
                      ]
                    }
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "capability": {
                          "type": "string",
                          "enum": [
                            "text.generate",
                            "text.classify",
                            "image.generate",
                            "image.edit",
                            "image.upscale",
                            "image.remove-background",
                            "video.text-to-video",
                            "video.image-to-video",
                            "speech.transcribe"
                          ]
                        },
                        "tier": {
                          "type": "string",
                          "enum": [
                            "default",
                            "premium",
                            "cheap"
                          ]
                        },
                        "provider": {
                          "type": "string"
                        },
                        "modelId": {
                          "type": "string"
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        },
                        "costPerUnit": {
                          "type": "number"
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "textRendering",
                              "referenceImages",
                              "inpainting",
                              "audio"
                            ]
                          }
                        },
                        "version": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "workspaceId": {
                          "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"
                            }
                          ]
                        },
                        "plan": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "capability",
                        "tier",
                        "provider",
                        "modelId",
                        "params",
                        "costPerUnit",
                        "priority",
                        "enabled",
                        "features",
                        "version",
                        "workspaceId",
                        "plan"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/model-routes/{id}/evaluate": {
      "post": {
        "summary": "Run the golden prompt set against a route",
        "description": "Calls this route’s model directly rather than through the fallback chain, so the result measures this route and not whatever would have answered instead. A passing run is what lets the route be enabled (§36.10).",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_evaluate",
        "x-public-api": true,
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "passed": {
                          "type": "boolean"
                        },
                        "ran": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "failed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "cases": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "passed": {
                                "type": "boolean"
                              },
                              "failures": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "error": {
                                "type": "string"
                              },
                              "durationMs": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "id",
                              "passed",
                              "failures",
                              "durationMs"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "passed",
                        "ran",
                        "failed",
                        "cases"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/model-routes/seed-defaults": {
      "post": {
        "summary": "Write the built-in defaults for any adapter that has none",
        "description": "Idempotent, and it never touches a route that already exists - those are the ones somebody has tuned. Everything it writes is disabled.",
        "tags": [
          "admin"
        ],
        "operationId": "AdminRoutes_seedDefaults",
        "x-public-api": true,
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "created"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/api-keys": {
      "get": {
        "summary": "List the workspace’s API keys",
        "description": "Never includes a secret. A secret exists once, in the response that created it.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_listKeys",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "OWNER",
                              "ADMIN",
                              "APPROVER",
                              "COLLABORATOR"
                            ]
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "POSTS_READ",
                                "POSTS_WRITE",
                                "ACCOUNTS_READ",
                                "MEDIA_READ",
                                "MEDIA_WRITE",
                                "ORGANISE_READ",
                                "ORGANISE_WRITE",
                                "WEBHOOKS_MANAGE",
                                "INBOX_READ",
                                "INBOX_WRITE",
                                "AI_GENERATE"
                              ]
                            }
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "prefix",
                          "role",
                          "scopes",
                          "lastUsedAt",
                          "expiresAt",
                          "revokedAt",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an API key",
        "description": "The only response that carries the secret. Store it now - it cannot be read back.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_createKey",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "role": {
                    "default": "COLLABORATOR",
                    "type": "string",
                    "enum": [
                      "OWNER",
                      "ADMIN",
                      "APPROVER",
                      "COLLABORATOR"
                    ]
                  },
                  "scopes": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "POSTS_READ",
                        "POSTS_WRITE",
                        "ACCOUNTS_READ",
                        "MEDIA_READ",
                        "MEDIA_WRITE",
                        "ORGANISE_READ",
                        "ORGANISE_WRITE",
                        "WEBHOOKS_MANAGE",
                        "INBOX_READ",
                        "INBOX_WRITE",
                        "AI_GENERATE"
                      ]
                    }
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650
                  }
                },
                "required": [
                  "name",
                  "scopes"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "OWNER",
                            "ADMIN",
                            "APPROVER",
                            "COLLABORATOR"
                          ]
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "POSTS_READ",
                              "POSTS_WRITE",
                              "ACCOUNTS_READ",
                              "MEDIA_READ",
                              "MEDIA_WRITE",
                              "ORGANISE_READ",
                              "ORGANISE_WRITE",
                              "WEBHOOKS_MANAGE",
                              "INBOX_READ",
                              "INBOX_WRITE",
                              "AI_GENERATE"
                            ]
                          }
                        },
                        "lastUsedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "expiresAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "revokedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "secret": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "prefix",
                        "role",
                        "scopes",
                        "lastUsedAt",
                        "expiresAt",
                        "revokedAt",
                        "createdAt",
                        "secret"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/api-keys/{keyId}": {
      "delete": {
        "summary": "Revoke an API key",
        "description": "Takes effect on the next request made with it. Revoking cannot be undone.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_revokeKey",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/usage": {
      "get": {
        "summary": "API requests this month, against the plan",
        "description": "Counted from the usage ledger, which is what an invoice is argued from.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_usage",
        "x-public-api": true,
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "plan": {
                          "type": "string",
                          "enum": [
                            "FREE",
                            "STARTER",
                            "GROWTH",
                            "SCALE"
                          ]
                        },
                        "planLabel": {
                          "type": "string"
                        },
                        "periodStart": {
                          "type": "string"
                        },
                        "periodEnd": {
                          "type": "string"
                        },
                        "requests": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "requestQuota": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "burstPerMinute": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        },
                        "planThatLifts": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "FREE",
                                "STARTER",
                                "GROWTH",
                                "SCALE"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "plan",
                        "planLabel",
                        "periodStart",
                        "periodEnd",
                        "requests",
                        "requestQuota",
                        "burstPerMinute",
                        "planThatLifts"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/webhook-endpoints": {
      "get": {
        "summary": "List webhook endpoints",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_listEndpoints",
        "x-public-api": true,
        "x-required-scopes": [
          "WEBHOOKS_MANAGE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "POST_PUBLISHED",
                                "POST_FAILED",
                                "ACCOUNT_NEEDS_RECONNECT"
                              ]
                            }
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "events",
                          "active",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Add a webhook endpoint",
        "description": "Returns the signing secret once. Every delivery is signed with it over the raw body.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_createEndpoint",
        "x-public-api": true,
        "x-required-scopes": [
          "WEBHOOKS_MANAGE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "POST_PUBLISHED",
                        "POST_FAILED",
                        "ACCOUNT_NEEDS_RECONNECT"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "POST_PUBLISHED",
                              "POST_FAILED",
                              "ACCOUNT_NEEDS_RECONNECT"
                            ]
                          }
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "secret": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "active",
                        "createdAt",
                        "secret"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/webhook-endpoints/{endpointId}": {
      "patch": {
        "summary": "Change which events an endpoint receives, or switch it off",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_updateEndpoint",
        "x-public-api": true,
        "x-required-scopes": [
          "WEBHOOKS_MANAGE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "events": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "POST_PUBLISHED",
                        "POST_FAILED",
                        "ACCOUNT_NEEDS_RECONNECT"
                      ]
                    }
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$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)$"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "POST_PUBLISHED",
                              "POST_FAILED",
                              "ACCOUNT_NEEDS_RECONNECT"
                            ]
                          }
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "active",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Remove a webhook endpoint",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_deleteEndpoint",
        "x-public-api": true,
        "x-required-scopes": [
          "WEBHOOKS_MANAGE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Replaying a write with the same key returns the first response and produces no second effect.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "ok": {
                          "type": "boolean",
                          "const": true
                        }
                      },
                      "required": [
                        "ok"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceId}/webhook-deliveries": {
      "get": {
        "summary": "What we sent, and what came back",
        "description": "Newest first. A failed delivery keeps the reason it failed.",
        "tags": [
          "developer"
        ],
        "operationId": "Developer_deliveries",
        "x-public-api": true,
        "x-required-scopes": [
          "WEBHOOKS_MANAGE"
        ],
        "x-required-role": "ADMIN",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "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)$"
                          },
                          "endpointId": {
                            "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)$"
                          },
                          "event": {
                            "type": "string",
                            "enum": [
                              "POST_PUBLISHED",
                              "POST_FAILED",
                              "ACCOUNT_NEEDS_RECONNECT"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "DELIVERED",
                              "FAILED"
                            ]
                          },
                          "attempt": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "responseStatus": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextAttemptAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deliveredAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "endpointId",
                          "event",
                          "status",
                          "attempt",
                          "responseStatus",
                          "error",
                          "nextAttemptAt",
                          "deliveredAt",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Liveness and database reachability",
        "tags": [
          "health"
        ],
        "operationId": "Health_check",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok",
                            "degraded"
                          ]
                        },
                        "database": {
                          "type": "string",
                          "enum": [
                            "up",
                            "down"
                          ]
                        },
                        "uptimeSeconds": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "status",
                        "database",
                        "uptimeSeconds"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/health/push-key": {
      "get": {
        "summary": "The VAPID public key, or null when push is not configured",
        "tags": [
          "health"
        ],
        "operationId": "Health_pushKey",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "properties": {
                        "publicKey": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "publicKey"
                      ],
                      "additionalProperties": false
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/health/launch": {
      "get": {
        "summary": "Publish rate, lag, token health, webhook lag and AI cost",
        "description": "Over a window of hours, from our own tables. Nothing here reaches Meta, a billing provider or a model - a health endpoint that depended on a third party would go down with them.",
        "tags": [
          "health"
        ],
        "operationId": "Health_launchMetrics",
        "x-public-api": true,
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "data": {
                      "$schema": "https://json-schema.org/draft/2020-12/schema",
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "error"
                  ],
                  "properties": {
                    "success": {
                      "const": false
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "details": {}
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
