# Refine Structured Prompt Refines a Structured Prompt object (such as a Visual Schema or an Image Caption) based on user instructions. Access Control & Validation: * Dataset Ownership: Requires a valid dataset_id to verify that the API token belongs to the organization owning the dataset. * Draft Status: The referenced dataset must be in draft mode. Refinement is disabled for completed datasets. Use Cases: 1. Refine Visual Schema: Input the initial schema generated by Bria and instructions like "Make the style description more detailed". 2. Refine Image Caption: Input a specific image's caption and instructions like "Fix the description of the hair color". The endpoint uses a VLM/LLM to process the input JSON and instructions, returning a valid, modified JSON structure that preserves the required format. Endpoint: POST /tailored-gen/refine_structured_prompt ## Header parameters: - `api_token` (string, required) ## Request fields (application/json): - `dataset_id` (integer, required) The ID of the dataset associated with this refinement. Used to validate ownership and draft status. - `structured_prompt` (string, required) The current structured prompt string (Visual Schema or Caption) to be refined. - `instruction` (string, required) Natural language instruction describing how to modify the JSON (e.g., "Add a field for mood", "Correct the object color"). - `context_images` (array) Optional. List of image URLs or Base64 strings to provide visual context for the refinement (useful when refining specific image captions). ## Response 200 fields (application/json): - `structured_prompt` (string) The refined Structured Prompt string. ## Response 400 fields ## Response 401 fields ## Response 403 fields ## Response 404 fields ## Response 429 fields ## Response 500 fields