{
  "openapi": "3.1.0",
  "info": {
    "title": "UGC Inc API",
    "description": "Public API surface for accounts, posts, comments, tasks, media, organization management, billing, statistics, and automations.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.ugc.inc"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/accounts": {
      "post": {
        "operationId": "accounts_get_post",
        "summary": "Get Accounts",
        "description": "Retrieve accounts with optional filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/create": {
      "post": {
        "operationId": "accounts_create_post",
        "summary": "Create Accounts",
        "description": "Create new account seats and update your subscription billing",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/delete-posts": {
      "post": {
        "operationId": "accounts_delete_posts_post",
        "summary": "Delete All Posts",
        "description": "Delete all posts from one or more accounts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/niche-switch": {
      "post": {
        "operationId": "accounts_niche_switch_post",
        "summary": "Niche Switch",
        "description": "Switch account niche by updating keywords and description, and resetting warmup",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/profile-sync-status": {
      "post": {
        "operationId": "accounts_profile_sync_status_post",
        "summary": "Get Profile Sync Status",
        "description": "Check if custom provider account profiles are in sync with live social profiles",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/reset-warmup": {
      "post": {
        "operationId": "accounts_reset_warmup_post",
        "summary": "Reset Account Warmup",
        "description": "Reset or delete warmup activity for an account",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/status": {
      "post": {
        "operationId": "accounts_status_post",
        "summary": "Get Account Status",
        "description": "Get account status and pending tasks",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/troubleshoot": {
      "post": {
        "operationId": "accounts_troubleshoot_post",
        "summary": "Troubleshoot Accounts",
        "description": "Check the health of active accounts and identify issues",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/update-info": {
      "post": {
        "operationId": "accounts_update_info_post",
        "summary": "Update Account Info",
        "description": "Update account metadata for one or more accounts (tag, groups, keywords, profiles, description, warmup version)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/accounts/update-social": {
      "post": {
        "operationId": "accounts_update_social_post",
        "summary": "Update Account Social Profile",
        "description": "Update account social profile for one or more accounts (username, avatar, nickname, bio)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/create": {
      "post": {
        "operationId": "automations_create_post",
        "summary": "Create or Update Automation Template",
        "description": "Create a new automation template or update an existing one",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/delete": {
      "post": {
        "operationId": "automations_delete_post",
        "summary": "Delete Automation Template",
        "description": "Delete an automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/delete-run": {
      "post": {
        "operationId": "automations_delete_run_post",
        "summary": "Delete Automation Run",
        "description": "Delete a run and its execution state",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/export": {
      "post": {
        "operationId": "automations_export_post",
        "summary": "Export Automation Template",
        "description": "Export full template data for debugging and tooling",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/export-run": {
      "post": {
        "operationId": "automations_export_run_post",
        "summary": "Export Automation Run",
        "description": "Export full run data including executor and edge state",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/get": {
      "post": {
        "operationId": "automations_get_post",
        "summary": "Get Automation Template",
        "description": "Retrieve a single automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/list": {
      "post": {
        "operationId": "automations_list_post",
        "summary": "List Automation Templates",
        "description": "Retrieve all automation templates for the authenticated organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/list-all-runs": {
      "post": {
        "operationId": "automations_list_all_runs_post",
        "summary": "List All Automation Runs",
        "description": "List automation runs across templates",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/list-runs": {
      "post": {
        "operationId": "automations_list_runs_post",
        "summary": "List Template Runs",
        "description": "List runs for a specific automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/logs": {
      "post": {
        "operationId": "automations_logs_post",
        "summary": "Get Automation Run Logs",
        "description": "Retrieve run logs ordered by creation time",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/publish": {
      "post": {
        "operationId": "automations_publish_post",
        "summary": "Publish Automation",
        "description": "Enable recurrence scheduling for an automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/recurrence-status": {
      "post": {
        "operationId": "automations_recurrence_status_post",
        "summary": "Get Recurrence Status",
        "description": "Get scheduling status for a recurring automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/run": {
      "post": {
        "operationId": "automations_run_post",
        "summary": "Run Automation",
        "description": "Start one or more runs for an automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/run-once": {
      "post": {
        "operationId": "automations_run_once_post",
        "summary": "Run Automation Once",
        "description": "Immediately trigger one manual run for a template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/status": {
      "post": {
        "operationId": "automations_status_post",
        "summary": "Get Automation Run Status",
        "description": "Get run state, executors, and execution edges",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/stop": {
      "post": {
        "operationId": "automations_stop_post",
        "summary": "Stop Automation Run",
        "description": "Stop an in-progress run",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/unpublish": {
      "post": {
        "operationId": "automations_unpublish_post",
        "summary": "Unpublish Automation",
        "description": "Disable recurrence scheduling for an automation template",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/update-review-status": {
      "post": {
        "operationId": "automations_update_review_status_post",
        "summary": "Update Run Review Status",
        "description": "Approve or reject an automation run",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/automations/validate": {
      "post": {
        "operationId": "automations_validate_post",
        "summary": "Validate Workflow",
        "description": "Validate an automation workflow definition without saving it",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/billing": {
      "get": {
        "operationId": "billing_get_get",
        "summary": "Get Billing",
        "description": "Get billing information including subscription details and linked organizations",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/billing/cancel-account": {
      "post": {
        "operationId": "billing_cancel_account_post",
        "summary": "Cancel Account",
        "description": "Cancel the subscription for a single account at the end of the current billing period",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "account_id"
                ]
              }
            }
          }
        }
      }
    },
    "/billing/reactivate-account": {
      "post": {
        "operationId": "billing_reactivate_account_post",
        "summary": "Reactivate Account",
        "description": "Undo a pending cancellation on an account",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "account_id"
                ]
              }
            }
          }
        }
      }
    },
    "/billing/cancel-subscription": {
      "post": {
        "operationId": "billing_cancel_subscription_post",
        "summary": "Cancel Subscription",
        "description": "Cancel every account under this billing at the end of the current billing period",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/billing/portal": {
      "post": {
        "operationId": "billing_portal_post",
        "summary": "Billing Portal",
        "description": "Get a Stripe billing portal URL for managing payment methods",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/billing/request-refund": {
      "post": {
        "operationId": "billing_request_refund_post",
        "summary": "Request Refund",
        "description": "Request a refund for an account",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/billing/request-replacement": {
      "post": {
        "operationId": "billing_request_replacement_post",
        "summary": "Request Replacement",
        "description": "Request a replacement for an account",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/billing/requests": {
      "get": {
        "operationId": "billing_requests_get",
        "summary": "Get Billing Requests",
        "description": "Get all billing requests (replacements and refunds)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/comment": {
      "post": {
        "operationId": "comments_list_post",
        "summary": "Get Comments",
        "description": "Get comments for your organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/comment/create": {
      "post": {
        "operationId": "comments_create_post",
        "summary": "Create Comment",
        "description": "Create a comment on a TikTok post",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media": {
      "post": {
        "operationId": "media_get_post",
        "summary": "Get Media",
        "description": "Retrieve media files with optional filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/create": {
      "post": {
        "operationId": "media_create_post",
        "summary": "Create Media from URLs",
        "description": "Create media records from files already uploaded to blob storage",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/create/text": {
      "post": {
        "operationId": "media_create_text_post",
        "summary": "Create Text Media",
        "description": "Create text media entries from raw text content",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/create/url": {
      "post": {
        "operationId": "media_create_url_post",
        "summary": "Get Upload Token",
        "description": "Generate a Vercel Blob client token for direct media uploads",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/delete": {
      "post": {
        "operationId": "media_delete_post",
        "summary": "Delete Media",
        "description": "Delete one or more media items",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/file/{path}": {
      "get": {
        "operationId": "media_file_get",
        "summary": "Get Media File",
        "description": "Fetch media content by ID (supports preview/audio paths and HTTP range requests)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "Media path. Examples: `media_123`, `media_123/preview`, `media_123/audio`.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/media/filter": {
      "post": {
        "operationId": "media_filter_post",
        "summary": "Filter Media by Usage",
        "description": "Filter source IDs into available vs used for a named media use-case",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/social-audio": {
      "post": {
        "operationId": "media_social_audio_get_post",
        "summary": "Get Social Audio",
        "description": "Retrieve social audio files with optional filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/social-audio/upload": {
      "post": {
        "operationId": "media_social_audio_upload_post",
        "summary": "Upload Social Audio",
        "description": "Import audio from a TikTok or Instagram URL",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/update-name": {
      "post": {
        "operationId": "media_update_name_post",
        "summary": "Update Media Name",
        "description": "Update the name of a media item",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/update-tag": {
      "post": {
        "operationId": "media_update_tag_post",
        "summary": "Update Media Tag",
        "description": "Update tags on one or more media items",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/use": {
      "post": {
        "operationId": "media_use_post",
        "summary": "Get Media Use Entries",
        "description": "Get media usage records for a specific use-case name",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org": {
      "get": {
        "operationId": "org_get_get",
        "summary": "Get Organizations",
        "description": "List organizations linked to your API key",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/org/api-key": {
      "post": {
        "operationId": "org_api_keys_list_post",
        "summary": "List API Keys",
        "description": "Retrieve all API keys for your organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/api-key/delete": {
      "post": {
        "operationId": "org_api_keys_delete_post",
        "summary": "Delete API Key",
        "description": "Delete an API key from your organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/api-key/edit": {
      "post": {
        "operationId": "org_api_keys_edit_post",
        "summary": "Edit API Key",
        "description": "Update an API key's name",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/integration-key": {
      "post": {
        "operationId": "org_integration_keys_list_post",
        "summary": "List Integration Keys",
        "description": "Retrieve all integration keys for your organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/integration-key/delete": {
      "post": {
        "operationId": "org_integration_keys_delete_post",
        "summary": "Delete Integration Key",
        "description": "Delete an integration key for a provider",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/integration-key/upsert": {
      "post": {
        "operationId": "org_integration_keys_upsert_post",
        "summary": "Upsert Integration Key",
        "description": "Create or update an integration key for a provider",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/org/name": {
      "post": {
        "operationId": "org_update_name_post",
        "summary": "Update Organization Name",
        "description": "Update your organization's name",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post": {
      "post": {
        "operationId": "posts_get_post",
        "summary": "Get Posts",
        "description": "Retrieve posts with optional filters",
        "responses": {
          "200": {
            "description": "Success. Each post includes failure (PublicPostFailure or null), in either the data array or data.posts for the page response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PostWithFailure"
                          }
                        },
                        {
                          "type": "object",
                          "required": [
                            "posts"
                          ],
                          "properties": {
                            "posts": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/PostWithFailure"
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/delete": {
      "post": {
        "operationId": "posts_delete_post",
        "summary": "Delete Posts",
        "description": "Delete one or more posts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/preview-schedule": {
      "post": {
        "operationId": "posts_preview_schedule_post",
        "summary": "Preview Schedule",
        "description": "Preview finalized post times before creating or updating posts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/retry": {
      "post": {
        "operationId": "posts_retry_post",
        "summary": "Retry Posts",
        "description": "Retry one or more failed posts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/slideshow": {
      "post": {
        "operationId": "posts_create_slideshow_post",
        "summary": "Create Slideshow Post",
        "description": "Create a slideshow post from multiple images",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/status": {
      "post": {
        "operationId": "posts_status_post",
        "summary": "Get Post Status",
        "description": "Get the status of a specific post",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "failure": {
                          "$ref": "#/components/schemas/PublicPostFailure"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/update": {
      "post": {
        "operationId": "posts_update_post",
        "summary": "Update Post",
        "description": "Update an existing scheduled or failed post in place",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/post/video": {
      "post": {
        "operationId": "posts_create_video_post",
        "summary": "Create Video Post",
        "description": "Create a video post. Optionally accepts captionOverlays \u2014 text overlays to display on the video, each { text, x, y, fontSize } with x/y as the overlay center as a fraction (0-1) of the video width/height and fontSize as a fraction (0-1) of the video height. Returned on the post as caption_overlays.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/accounts": {
      "post": {
        "operationId": "stats_accounts_post",
        "summary": "Get Account Statistics",
        "description": "Retrieve account statistics with filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/aggregated/daily": {
      "post": {
        "operationId": "stats_aggregated_daily_post",
        "summary": "Get Daily Aggregated Statistics",
        "description": "Get pre-aggregated daily statistics for dashboard charts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/aggregated/daily-posts": {
      "post": {
        "operationId": "stats_aggregated_daily_posts_post",
        "summary": "Get Daily Post Stats",
        "description": "Get per-post daily metric values and changes",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/aggregated/top-accounts": {
      "post": {
        "operationId": "stats_aggregated_top_accounts_post",
        "summary": "Get Top Accounts",
        "description": "Get the highest-performing accounts by a specific metric",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/aggregated/top-posts": {
      "post": {
        "operationId": "stats_aggregated_top_posts_post",
        "summary": "Get Top Posts",
        "description": "Get the highest-performing posts by a specific metric",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/dashboard/daily": {
      "post": {
        "operationId": "stats_dashboard_daily_post",
        "summary": "Get Dashboard Daily Statistics",
        "description": "Retrieve pre-aggregated daily statistics for dashboard charts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/granular/daily-accounts": {
      "post": {
        "operationId": "stats_granular_daily_accounts_post",
        "summary": "Get Daily Account Stats (Granular)",
        "description": "Get per-account daily metric deltas",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/posts": {
      "post": {
        "operationId": "stats_posts_post",
        "summary": "Get Post Statistics",
        "description": "Retrieve post statistics with filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/stats/refresh": {
      "post": {
        "operationId": "stats_refresh_post",
        "summary": "Refresh Statistics",
        "description": "Fetch live statistics from TikTok/Instagram API for all accounts in your organization",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Stream-Progress",
            "in": "header",
            "required": false,
            "description": "Set to `true` to receive newline-delimited JSON progress events instead of the standard JSON summary response.",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/tasks": {
      "post": {
        "operationId": "tasks_get_post",
        "summary": "Get Tasks",
        "description": "Retrieve tasks with optional filters",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/tasks/delete": {
      "post": {
        "operationId": "tasks_delete_post",
        "summary": "Delete Tasks",
        "description": "Delete one or more scheduled or failed tasks",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/tasks/retry": {
      "post": {
        "operationId": "tasks_retry_post",
        "summary": "Retry Tasks",
        "description": "Retry one or more failed tasks",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/media/render/imessage": {
      "post": {
        "operationId": "renderIMessageConversation",
        "summary": "Render iMessage conversation",
        "tags": [
          "Native iMessage"
        ],
        "description": "Requires content:render for scoped keys. Submission queues work and does not wait for completion. Reuse the same body and idempotencyKey to recover a job.",
        "parameters": [
          {
            "name": "orgId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional organization selection for a key authorized for that organization. Usually derived from the bearer key; never grants access to another organization."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IMessageConversationInput"
              },
              "example": {
                "contact": {
                  "name": "Alex"
                },
                "theme": "dark",
                "timing": {
                  "charactersPerSecond": 8,
                  "incomingTypingDurationMs": 2400
                },
                "messages": [
                  {
                    "id": "hello",
                    "sender": "recipient",
                    "text": "Ready?",
                    "initial": true
                  },
                  {
                    "id": "answer",
                    "sender": "user",
                    "text": "On my way \ud83d\udc4b",
                    "receipt": "delivered"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted or current job state. A completed, failed or cancelled render is also an HTTP 200 job-state response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageConversationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "403": {
            "description": "API key lacks content:render permission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key already used with different request content.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "502": {
            "description": "Invalid result from rendering service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "503": {
            "description": "Rendering temporarily unavailable; retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          }
        }
      }
    },
    "/media/render/imessage/status": {
      "post": {
        "operationId": "getIMessageConversation",
        "summary": "Get iMessage render status",
        "tags": [
          "Native iMessage"
        ],
        "description": "Requires content:render for scoped keys. Only jobs belonging to the selected organization are accessible. Poll pending/processing jobs; completed output includes a public HTTPS URL.",
        "parameters": [
          {
            "name": "orgId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional organization selection for a key authorized for that organization. Usually derived from the bearer key; never grants access to another organization."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IMessageJobRequest"
              },
              "example": {
                "jobId": "7f840d59-6c9d-4b58-9f7c-21b953579069"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted or current job state. A completed, failed or cancelled render is also an HTTP 200 job-state response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageConversationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "403": {
            "description": "API key lacks content:render permission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Job is not owned by this organization or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "502": {
            "description": "Invalid result from rendering service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "503": {
            "description": "Rendering temporarily unavailable; retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          }
        }
      }
    },
    "/media/render/imessage/cancel": {
      "post": {
        "operationId": "cancelIMessageConversation",
        "summary": "Cancel iMessage render",
        "tags": [
          "Native iMessage"
        ],
        "description": "Requires content:render for scoped keys. Only jobs belonging to the selected organization are accessible. Requests cooperative cancellation; poll until terminal. Completed work is retained if cancellation arrives too late.",
        "parameters": [
          {
            "name": "orgId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional organization selection for a key authorized for that organization. Usually derived from the bearer key; never grants access to another organization."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IMessageJobRequest"
              },
              "example": {
                "jobId": "7f840d59-6c9d-4b58-9f7c-21b953579069"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted or current job state. A completed, failed or cancelled render is also an HTTP 200 job-state response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageConversationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input or organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "403": {
            "description": "API key lacks content:render permission.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "404": {
            "description": "Job is not owned by this organization or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "502": {
            "description": "Invalid result from rendering service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          },
          "503": {
            "description": "Rendering temporarily unavailable; retryable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IMessageRequestError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "PublicPostFailure": {
        "type": [
          "object",
          "null"
        ],
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "recovery",
          "next_action"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "AUDIO_UNAVAILABLE",
              "BACKUP_AUDIO_RETRY_PENDING",
              "AUDIO_RETRY_PENDING",
              "AUDIO_PREPARATION_FAILED",
              "PUBLISHING_RETRY_PENDING",
              "PUBLISHING_BLOCKED",
              "POST_PROCESSING_FAILED",
              "PUBLICATION_CHECK_IN_PROGRESS",
              "PUBLICATION_UNCONFIRMED",
              "POST_RETRY_PENDING",
              "POST_FAILED"
            ]
          },
          "message": {
            "type": "string"
          },
          "recovery": {
            "type": "string",
            "enum": [
              "retry_pending",
              "waiting",
              "verifying_publication",
              "stopped"
            ]
          },
          "next_action": {
            "type": "string",
            "enum": [
              "wait",
              "change_audio",
              "change_audio_or_contact_support",
              "contact_support"
            ]
          }
        }
      },
      "PostWithFailure": {
        "type": "object",
        "required": [
          "id",
          "status",
          "failure"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "failure": {
            "$ref": "#/components/schemas/PublicPostFailure"
          }
        }
      },
      "IMessageTiming": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "charactersPerSecond": {
            "type": "number",
            "minimum": 0.5,
            "maximum": 60,
            "default": 8,
            "description": "Complete visible grapheme clusters per second."
          },
          "pauseBeforeMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30000,
            "description": "Pause before typing or the local reply gesture; follows reserved native transition completion.",
            "default": 450
          },
          "pauseBeforeSendMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Pause between the completed local composition and sending.",
            "default": 180
          },
          "punctuationPauseMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2000,
            "default": 160
          },
          "variation": {
            "type": "number",
            "minimum": 0,
            "maximum": 0.75,
            "default": 0.15,
            "description": "Seeded proportional variation in character delay."
          },
          "incomingTypingDurationMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30000,
            "description": "Explicit remote response duration; overrides calculated incoming typing duration. May be global or on incoming messages only."
          },
          "keyboardSwitchPauseMs": {
            "type": "integer",
            "minimum": 350,
            "maximum": 10000,
            "default": 450
          },
          "emojiSelectionDelayMs": {
            "type": "integer",
            "minimum": 100,
            "maximum": 10000,
            "default": 350
          }
        },
        "description": "Every field is optional. Per-message timing takes precedence over global timing. Defaults shown apply after both levels are checked."
      },
      "IMessageReaction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "actor"
        ],
        "properties": {
          "actor": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "action": {
            "type": "string",
            "enum": [
              "set",
              "remove"
            ],
            "default": "set"
          },
          "reaction": {
            "type": "string",
            "enum": [
              "love",
              "like",
              "dislike",
              "laugh",
              "emphasize",
              "question"
            ]
          },
          "emoji": {
            "type": "string",
            "description": "Exactly one complete emoji grapheme. Available for remote participants only.",
            "minLength": 1,
            "maxLength": 32
          },
          "delayMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 60000,
            "description": "From target message arrival, or video start for initial history. Earliest picker-open time for local actions; exact arrival time for remote actions.",
            "default": 700
          },
          "menuDurationMs": {
            "type": "integer",
            "minimum": 400,
            "maximum": 10000,
            "description": "Local picker hold before selection. Remote reactions do not open a local picker.",
            "default": 700
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "remove"
                }
              },
              "required": [
                "action"
              ]
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "reaction"
                    ]
                  },
                  {
                    "required": [
                      "emoji"
                    ]
                  }
                ]
              }
            },
            "else": {
              "oneOf": [
                {
                  "required": [
                    "reaction"
                  ],
                  "not": {
                    "required": [
                      "emoji"
                    ]
                  }
                },
                {
                  "required": [
                    "emoji"
                  ],
                  "not": {
                    "required": [
                      "reaction"
                    ]
                  }
                }
              ]
            }
          }
        ],
        "description": "Setting again replaces that actor\u2019s prior reaction. Remove requires an existing reaction from the same actor. Local actions accept only the six classic reactions and use the visible native menu."
      },
      "IMessageMessage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sender"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "sender": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "description": "user or recipient for direct chats; a participant ID for groups."
          },
          "text": {
            "type": "string",
            "description": "Nonempty printable Unicode, at most 2,000 UTF-16 code units. Supply exactly one of text or imagePngBase64.",
            "minLength": 1,
            "maxLength": 2000
          },
          "imagePngBase64": {
            "type": "string",
            "description": "Base64 single-frame PNG without data URL prefix; decoded size at most 2048\u00d72048. Mixed image/text captions are unsupported.",
            "maxLength": 8388608,
            "pattern": "^iVBORw0KGgo[A-Za-z0-9+/]*={0,2}$"
          },
          "initial": {
            "type": "boolean",
            "default": false,
            "description": "Preexisting history; initial messages must be a prefix."
          },
          "showTyping": {
            "type": "boolean",
            "description": "Incoming indicator override. Not accepted on outgoing messages."
          },
          "receipt": {
            "type": "string",
            "enum": [
              "none",
              "delivered",
              "read"
            ],
            "default": "none",
            "description": "Outgoing messages only; read requires readAt."
          },
          "readAt": {
            "type": "string",
            "description": "ISO 8601 timestamp with an explicit timezone.",
            "format": "date-time"
          },
          "receiptDelayMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30000,
            "default": 500
          },
          "timing": {
            "$ref": "#/components/schemas/IMessageTiming"
          },
          "replyTo": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "description": "An earlier message ID; never a forward reference."
          },
          "sentAt": {
            "type": "string",
            "description": "ISO 8601 timestamp with an explicit timezone.",
            "format": "date-time"
          },
          "timestampText": {
            "type": "string",
            "description": "Trimmed nonempty printable Unicode.",
            "minLength": 1,
            "maxLength": 80
          },
          "reactions": {
            "type": "array",
            "maxItems": 20,
            "default": [],
            "items": {
              "$ref": "#/components/schemas/IMessageReaction"
            }
          }
        },
        "oneOf": [
          {
            "required": [
              "text"
            ],
            "not": {
              "required": [
                "imagePngBase64"
              ]
            }
          },
          {
            "required": [
              "imagePngBase64"
            ],
            "not": {
              "required": [
                "text"
              ]
            }
          }
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "receipt": {
                  "const": "read"
                }
              },
              "required": [
                "receipt"
              ]
            },
            "then": {
              "required": [
                "readAt"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "readAt"
                ]
              }
            }
          }
        ],
        "description": "IDs must be unique; omitted IDs become message-1, message-2, etc. If any message sets sentAt, all must set it in chronological order. timestampText forces a separator before this message."
      },
      "IMessageStatusBar": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "time": {
            "type": "string",
            "description": "Clock independent of conversation timestamps.",
            "pattern": "^(?:[01]?\\d|2[0-3]):[0-5]\\d$",
            "default": "9:41"
          },
          "wifiBars": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3,
            "default": 3
          },
          "wifiEnabled": {
            "type": "boolean",
            "default": true
          },
          "cellularBars": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4,
            "default": 4
          },
          "cellularEnabled": {
            "type": "boolean",
            "default": true
          },
          "batteryPercent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100,
            "description": "Native battery fill, not a numerical percentage label.",
            "default": 100
          },
          "charging": {
            "type": "boolean",
            "default": false
          },
          "lowPowerMode": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "IMessageContact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed nonempty printable Unicode.",
            "minLength": 1,
            "maxLength": 80
          },
          "avatarPngBase64": {
            "type": "string",
            "description": "Base64 PNG bytes, without a data URL prefix. Decoded image must be a single-frame PNG, at most 512\u00d7512 pixels. Native ContactsUI crops the avatar.",
            "maxLength": 65536,
            "pattern": "^iVBORw0KGgo[A-Za-z0-9+/]*={0,2}$"
          }
        }
      },
      "IMessageParticipant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$"
          },
          "name": {
            "type": "string",
            "description": "Trimmed nonempty printable Unicode.",
            "minLength": 1,
            "maxLength": 80
          },
          "avatarPngBase64": {
            "type": "string",
            "description": "Base64 PNG bytes, without a data URL prefix. Decoded image must be a single-frame PNG, at most 512\u00d7512 pixels. Native ContactsUI crops the avatar.",
            "maxLength": 65536,
            "pattern": "^iVBORw0KGgo[A-Za-z0-9+/]*={0,2}$"
          }
        }
      },
      "IMessageGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "participants"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed nonempty printable Unicode.",
            "minLength": 1,
            "maxLength": 80
          },
          "avatarPngBase64": {
            "type": "string",
            "description": "Base64 PNG bytes, without a data URL prefix. Decoded image must be a single-frame PNG, at most 512\u00d7512 pixels. Native ContactsUI crops the avatar.",
            "maxLength": 65536,
            "pattern": "^iVBORw0KGgo[A-Za-z0-9+/]*={0,2}$"
          },
          "localParticipantId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "default": "user"
          },
          "participants": {
            "type": "array",
            "minItems": 3,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/IMessageParticipant"
            },
            "description": "Unique IDs; must include localParticipantId."
          }
        }
      },
      "IMessageConversationOutput": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "const": "video"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "const": "png"
              },
              "atMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 120000,
                "description": "Exact requested millisecond timestamp; omission chooses the final authored frame. Must not exceed compiled duration."
              }
            }
          }
        ],
        "default": {
          "kind": "video"
        },
        "description": "Video is 60 fps H264 at 1126\u00d72436. PNG is 1125\u00d72436; no crop, resolution or codec control."
      },
      "IMessageConversationInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "messages"
        ],
        "properties": {
          "idempotencyKey": {
            "type": "string",
            "description": "Organization-scoped retry key. Reusing it with changed input returns 409.",
            "minLength": 1,
            "maxLength": 128
          },
          "profile": {
            "type": "string",
            "const": "iphone-xs-ios18.6.2",
            "default": "iphone-xs-ios18.6.2"
          },
          "contact": {
            "$ref": "#/components/schemas/IMessageContact"
          },
          "group": {
            "$ref": "#/components/schemas/IMessageGroup"
          },
          "statusBar": {
            "$ref": "#/components/schemas/IMessageStatusBar"
          },
          "unreadCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9999,
            "description": "Back-button badge; message count is messages.length.",
            "default": 0
          },
          "timestampText": {
            "type": "string",
            "description": "Trimmed nonempty printable Unicode.",
            "minLength": 1,
            "maxLength": 80
          },
          "theme": {
            "type": "string",
            "enum": [
              "light",
              "dark"
            ],
            "default": "dark"
          },
          "fps": {
            "type": "integer",
            "const": 60,
            "default": 60
          },
          "output": {
            "$ref": "#/components/schemas/IMessageConversationOutput"
          },
          "keyboard": {
            "type": "boolean",
            "default": true,
            "description": "Hide/show keyboard; outgoing emoji selection and local replies require true."
          },
          "seed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "default": 0
          },
          "timing": {
            "$ref": "#/components/schemas/IMessageTiming"
          },
          "showIncomingTyping": {
            "type": "boolean",
            "default": true
          },
          "endHoldMs": {
            "type": "integer",
            "minimum": 350,
            "maximum": 10000,
            "default": 1500
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "$ref": "#/components/schemas/IMessageMessage"
            }
          },
          "threads": {
            "type": "array",
            "maxItems": 10,
            "default": [],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "messageId",
                "openAtMs",
                "durationMs"
              ],
              "properties": {
                "messageId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,80}$"
                },
                "openAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 120000
                },
                "durationMs": {
                  "type": "integer",
                  "minimum": 600,
                  "maximum": 30000
                }
              }
            },
            "description": "Explicit read-only expanded reply views. Open after conversation/native transitions settle; views cannot overlap."
          }
        },
        "oneOf": [
          {
            "required": [
              "contact"
            ],
            "not": {
              "required": [
                "group"
              ]
            }
          },
          {
            "required": [
              "group"
            ],
            "not": {
              "required": [
                "contact"
              ]
            }
          }
        ],
        "description": "Synthetic conversation authoring only; no real message delivery. Total request limit 16 MiB, 6,000 animated graphemes,120-second compiled duration, and 16,777,216 aggregate message-image pixels. Unknown fields reject. Cross-field/native availability constraints are also validated; see full contract."
      },
      "IMessageConversationJob": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "jobId",
          "status",
          "progress",
          "fps",
          "output",
          "contentType",
          "durationInFrames",
          "durationMs"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "cancelRequested": {
            "type": "boolean",
            "description": "Cancellation requested; not proof cleanup has finished. Poll to terminal status."
          },
          "progress": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "fps": {
            "type": "integer",
            "const": 60
          },
          "output": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "const": "video"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "kind",
                  "atMs"
                ],
                "properties": {
                  "kind": {
                    "const": "png"
                  },
                  "atMs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 120000
                  }
                }
              }
            ]
          },
          "contentType": {
            "type": "string",
            "enum": [
              "image/png",
              "video/mp4"
            ]
          },
          "durationInFrames": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7201,
            "description": "Output frame count; PNG output is 1."
          },
          "durationMs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120000,
            "description": "Compiled conversation duration, even forPNG jobs."
          },
          "url": {
            "type": "string",
            "description": "Present on completion: publicly downloadable owned HTTPS media URL.",
            "format": "uri"
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "retryable"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "IMessageJobRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "jobId"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IMessageConversationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "const": 200
          },
          "data": {
            "$ref": "#/components/schemas/IMessageConversationJob"
          }
        },
        "description": "Raw HTTP response. SDK normalizes this to ApiResponse with ok:true and a message."
      },
      "IMessageRequestError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "errorCode": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "ok": {
            "type": "boolean",
            "const": false
          }
        },
        "description": "Error shape varies between authentication middleware and renderer. errorCode/retryable are provided for native conversation request failures."
      }
    }
  }
}
