# Publish Create POST /api/v1/videos/{video_id}/publish/ Content-Type: application/json Publish video by setting is_draft to False. Reference: https://docs.aisquare.studio/api-reference/ai-square-studio-api/videos/publish-create ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: AISquare Studio API version: 1.0.0 paths: /api/v1/videos/{video_id}/publish/: post: operationId: publish-create summary: Publish Create description: Publish video by setting is_draft to False. tags: - subpackage_videos parameters: - name: video_id in: path required: true schema: type: integer responses: '200': description: '' content: application/json: schema: $ref: '#/components/schemas/VideoDetail' requestBody: content: application/json: schema: $ref: '#/components/schemas/VideoDetail' components: schemas: GlobalCreationStatusEnum: type: string enum: - not_started - in_progress - completed - failed description: |- * `not_started` - Not Started * `in_progress` - In Progress * `completed` - Completed * `failed` - Failed title: GlobalCreationStatusEnum VideoSection: type: object properties: id: type: integer uid: type: string format: uuid created_at: type: string format: date-time updated_at: type: string format: date-time deleted_at: type: - string - 'null' format: date-time is_active: type: boolean created_by: type: - string - 'null' updated_by: type: - string - 'null' deleted_by: type: - string - 'null' alignment_data: description: Any type audio_ready: type: boolean visuals_ready: type: boolean is_assembling: type: boolean order: type: integer title: type: - string - 'null' content: description: Script content for this section (list of turns) duration: type: integer description: Duration in seconds video_file: type: - string - 'null' format: uri audio_file: type: - string - 'null' format: uri thumbnail: type: - string - 'null' format: uri section_summary: type: - string - 'null' description: Summary of the section content (User Facing) internal_notes: type: - string - 'null' description: Detailed internal notes for content generation page_numbers: type: - string - 'null' description: Page numbers from source documents status: $ref: '#/components/schemas/GlobalCreationStatusEnum' video: type: integer rag_documents: type: array items: type: integer required: - id - uid - created_at - updated_at - order - content - video title: VideoSection VideoTemplate: type: object properties: id: type: integer uid: type: string format: uuid created_at: type: string format: date-time updated_at: type: string format: date-time deleted_at: type: - string - 'null' format: date-time is_active: type: boolean created_by: type: - string - 'null' updated_by: type: - string - 'null' deleted_by: type: - string - 'null' name: type: string description: type: - string - 'null' thumbnail: type: - string - 'null' format: uri preview_video_url: type: - string - 'null' format: uri voices: type: array items: type: integer required: - id - uid - created_at - updated_at - name title: VideoTemplate SimpleUser: type: object properties: id: type: integer email: type: string format: email full_name: type: string username: type: string description: >- Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. is_verified: type: boolean profile_picture: type: string format: uri description: |- Convert ImageFieldFile to URL string for JSON serialization. Args: obj: The model instance being serialized (typically IAMUser) Returns: str | None: The URL of the profile picture, or None if not available required: - id - email - full_name - username - is_verified - profile_picture description: >- Simple user serializer with profile picture from associated IAMUserDetail. Fields: - id, email, full_name, username, is_verified (from IAMUser) - profile_picture (from first related IAMUserDetail if present) title: SimpleUser InternalStatusEnum: type: string enum: - planning - scripting - audio_sync - visuals - rendering - merging - completed - failed description: |- * `planning` - Planning Structure * `scripting` - Scripting & Visual Direction * `audio_sync` - Audio Generation & Sync * `visuals` - Visual Asset Generation * `rendering` - Section Rendering * `merging` - Final Assembly * `completed` - Success * `failed` - Error title: InternalStatusEnum GlobalVisibilityEnum: type: string enum: - public - private - team - org description: |- * `public` - Public * `private` - Private * `team` - Team * `org` - Organization title: GlobalVisibilityEnum VideoDetail: type: object properties: id: type: integer sections: type: array items: $ref: '#/components/schemas/VideoSection' template: $ref: '#/components/schemas/VideoTemplate' video: type: string owner: $ref: '#/components/schemas/SimpleUser' owner_username: type: string metrics: type: string tag_names: type: array items: type: string category_name: type: string subcategory_name: type: string custom_url: type: string uid: type: string format: uuid created_at: type: string format: date-time updated_at: type: string format: date-time deleted_at: type: - string - 'null' format: date-time is_active: type: boolean created_by: type: - string - 'null' updated_by: type: - string - 'null' deleted_by: type: - string - 'null' title: type: string description: type: - string - 'null' cover_image: type: - string - 'null' format: uri thumbnail: type: - string - 'null' format: uri description: Thumbnail image, also used as logo generated_script: type: - string - 'null' generation_progress: type: integer description: Progress percentage (0-100) status: $ref: '#/components/schemas/GlobalCreationStatusEnum' internal_status: $ref: '#/components/schemas/InternalStatusEnum' is_regenerating: type: boolean duration: type: - integer - 'null' description: Duration in seconds visibility: $ref: '#/components/schemas/GlobalVisibilityEnum' is_draft: type: boolean description: Whether this video is a draft plan: oneOf: - description: Any type - type: 'null' description: The video plan structure (sections, timings, prompts) workspace: type: integer source_experience: type: - integer - 'null' category: type: - integer - 'null' subcategory: type: - integer - 'null' tags: type: array items: type: integer required: - id - sections - template - video - owner - owner_username - metrics - tag_names - category_name - subcategory_name - custom_url - uid - created_at - updated_at - title - workspace title: VideoDetail ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/api/v1/videos/1/publish/" payload = { "title": "Launch Event Highlights", "workspace": 42 } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/api/v1/videos/1/publish/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"title":"Launch Event Highlights","workspace":42}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/api/v1/videos/1/publish/" payload := strings.NewReader("{\n \"title\": \"Launch Event Highlights\",\n \"workspace\": 42\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.example.com/api/v1/videos/1/publish/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"title\": \"Launch Event Highlights\",\n \"workspace\": 42\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.example.com/api/v1/videos/1/publish/") .header("Content-Type", "application/json") .body("{\n \"title\": \"Launch Event Highlights\",\n \"workspace\": 42\n}") .asString(); ``` ```php request('POST', 'https://api.example.com/api/v1/videos/1/publish/', [ 'body' => '{ "title": "Launch Event Highlights", "workspace": 42 }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/api/v1/videos/1/publish/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"title\": \"Launch Event Highlights\",\n \"workspace\": 42\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "title": "Launch Event Highlights", "workspace": 42 ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/api/v1/videos/1/publish/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```