{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robowrite-ai/json-schema/robowrite-ai-public-brief-schema.json",
  "title": "PublicBrief",
  "description": "Brief read model (response).\n\nContent and keyword fields only — lifecycle ownership metadata and deferred\nresearch inputs are not included.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robowrite-ai-openapi.yml#/components/schemas/PublicBrief",
  "properties": {
    "article_spec": {
      "$ref": "#/$defs/ArticleSpec"
    },
    "article_template": {
      "anyOf": [
        {
          "$ref": "#/$defs/ArticleTemplateKey"
        },
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Article Template"
    },
    "attached_document_ids": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "title": "Attached Document Ids",
      "type": "array"
    },
    "audience_details": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Audience Details"
    },
    "brand_id": {
      "format": "uuid",
      "title": "Brand Id",
      "type": "string"
    },
    "competitor_urls": {
      "items": {
        "type": "string"
      },
      "title": "Competitor Urls",
      "type": "array"
    },
    "content_goal": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Goal"
    },
    "content_hash_version": {
      "anyOf": [
        {
          "const": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Hash Version"
    },
    "content_sha256": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Sha256"
    },
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "cta": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cta"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "example_urls": {
      "items": {
        "type": "string"
      },
      "title": "Example Urls",
      "type": "array"
    },
    "facts": {
      "items": {
        "$ref": "#/$defs/PublicBriefFact"
      },
      "title": "Facts",
      "type": "array"
    },
    "format": {
      "$ref": "#/$defs/ContentFormat"
    },
    "funnel_stage": {
      "anyOf": [
        {
          "$ref": "#/$defs/FunnelStage"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "linked_content": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicPage_PublicContentSummary_"
        },
        {
          "type": "null"
        }
      ]
    },
    "must_avoid": {
      "items": {
        "type": "string"
      },
      "title": "Must Avoid",
      "type": "array"
    },
    "must_cover": {
      "items": {
        "type": "string"
      },
      "title": "Must Cover",
      "type": "array"
    },
    "notes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Notes"
    },
    "outline": {
      "items": {
        "type": "string"
      },
      "title": "Outline",
      "type": "array"
    },
    "pillar_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pillar Id"
    },
    "primary_keyword": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Primary Keyword"
    },
    "property_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Property Id"
    },
    "search_intent": {
      "anyOf": [
        {
          "$ref": "#/$defs/SearchIntent"
        },
        {
          "type": "null"
        }
      ]
    },
    "secondary_keywords": {
      "items": {
        "type": "string"
      },
      "title": "Secondary Keywords",
      "type": "array"
    },
    "source_topic_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Topic Id"
    },
    "source_urls": {
      "items": {
        "type": "string"
      },
      "title": "Source Urls",
      "type": "array"
    },
    "status": {
      "$ref": "#/$defs/TaskStatus"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "target_word_count": {
      "anyOf": [
        {
          "maximum": 3500,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Word Count"
    },
    "template_snapshot": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Snapshot"
    },
    "title": {
      "title": "Title",
      "type": "string"
    },
    "tone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tone"
    },
    "updated_at": {
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "version_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Version Id"
    }
  },
  "required": [
    "id",
    "brand_id",
    "title",
    "format",
    "status",
    "created_at",
    "updated_at"
  ],
  "type": "object",
  "$defs": {
    "ArticleElement": {
      "description": "The article elements a spec can require, allow or turn off.",
      "enum": [
        "citations",
        "stats",
        "key_takeaways",
        "quotes",
        "faq",
        "comparison_table",
        "steps",
        "toc",
        "relevant_links",
        "products"
      ],
      "title": "ArticleElement",
      "type": "string"
    },
    "ArticleReadingLevel": {
      "description": "The reader the article is written for.",
      "enum": [
        "beginner",
        "practitioner",
        "executive"
      ],
      "title": "ArticleReadingLevel",
      "type": "string"
    },
    "ArticleSpec": {
      "additionalProperties": false,
      "description": "What the article must contain, may contain, or must leave out.\n\nEvery key is optional and an absent key takes its default, so ``{}`` asks\nfor nothing beyond the standard article. ``elements`` names only the\nelements you change; the rest keep their defaults (citations, stats, key\ntakeaways, quotes, FAQ, relevant links and products optional; comparison\ntable, steps and table of contents off). Citations cannot be off; steps\nand comparison tables accept required, optional and off.\n\n``elements`` wins over a detail section: an element set to ``off`` ignores\nits details (``faq.questions``, ``products``, ``relevant_links``, ``stats``),\nwhich are kept so switching the element back on restores them. For\nproducts and relevant links, the element mode is only the default for new\nitems; each item's own ``requirement`` is what applies while the element is\non. ``reading_level.requirement: off`` means the level is not judged, the\nsame as leaving ``level`` empty.",
      "properties": {
        "citations": {
          "$ref": "#/$defs/CitationsSpec"
        },
        "elements": {
          "additionalProperties": {
            "$ref": "#/$defs/ElementRequirement"
          },
          "description": "Per-element mode for the elements you change (sparse).",
          "propertyNames": {
            "$ref": "#/$defs/ArticleElement"
          },
          "title": "Elements",
          "type": "object"
        },
        "faq": {
          "$ref": "#/$defs/FaqSpec"
        },
        "length": {
          "$ref": "#/$defs/LengthSpec"
        },
        "products": {
          "items": {
            "$ref": "#/$defs/ProductSpec"
          },
          "maxItems": 10,
          "title": "Products",
          "type": "array"
        },
        "reading_level": {
          "$ref": "#/$defs/ReadingLevelSpec"
        },
        "relevant_links": {
          "items": {
            "$ref": "#/$defs/RelevantLinkSpec"
          },
          "maxItems": 10,
          "title": "Relevant Links",
          "type": "array"
        },
        "schema_version": {
          "const": 1,
          "default": 1,
          "title": "Schema Version",
          "type": "integer"
        },
        "stats": {
          "$ref": "#/$defs/StatsSpec"
        },
        "voice": {
          "$ref": "#/$defs/VoiceSpec"
        }
      },
      "title": "ArticleSpec",
      "type": "object"
    },
    "ArticleTemplateKey": {
      "enum": [
        "standard",
        "listicle",
        "how_to",
        "comparison"
      ],
      "title": "ArticleTemplateKey",
      "type": "string"
    },
    "CitationsSpec": {
      "additionalProperties": false,
      "description": "How many distinct source URLs the article cites, and which ones.",
      "properties": {
        "max_sources": {
          "anyOf": [
            {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Most distinct source URLs the article may cite. null uses the workspace's max citations per article.",
          "title": "Max Sources"
        },
        "min_sources": {
          "anyOf": [
            {
              "maximum": 30,
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Fewest distinct source URLs the article must cite when citations are required. null means 1. At most max_sources.",
          "title": "Min Sources"
        },
        "required_source_urls": {
          "description": "Sources the article must cite at least once. Each must also be in the brief's source_urls.",
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "title": "Required Source Urls",
          "type": "array"
        }
      },
      "title": "CitationsSpec",
      "type": "object"
    },
    "ContentFormat": {
      "description": "Output format for content generation.",
      "enum": [
        "blog_post",
        "landing_page",
        "linkedin_post",
        "linkedin_article",
        "twitter_post",
        "twitter_thread",
        "newsletter",
        "video_script",
        "podcast_outline",
        "case_study",
        "whitepaper",
        "ebook",
        "infographic",
        "webinar",
        "email_sequence"
      ],
      "title": "ContentFormat",
      "type": "string"
    },
    "ElementRequirement": {
      "description": "How strongly the brief asks for an article element.\n\n``required``: the article must contain it. ``optional``: include it when\nthe evidence supports it. ``off``: never include it.",
      "enum": [
        "required",
        "optional",
        "off"
      ],
      "title": "ElementRequirement",
      "type": "string"
    },
    "FaqSpec": {
      "additionalProperties": false,
      "description": "Questions the article's FAQ answers first.",
      "properties": {
        "questions": {
          "items": {
            "type": "string"
          },
          "maxItems": 10,
          "title": "Questions",
          "type": "array"
        }
      },
      "title": "FaqSpec",
      "type": "object"
    },
    "FunnelStage": {
      "description": "Marketing funnel position.",
      "enum": [
        "tofu",
        "mofu",
        "bofu"
      ],
      "title": "FunnelStage",
      "type": "string"
    },
    "JobStatus": {
      "description": "Status of a background job.\n\nTerminal states: ``completed``, ``completed_with_errors``, ``failed``,\n``cancelled``. Active (in-progress) states: ``queued``, ``running``.\n\n``awaiting_review`` is a third class: not terminal (work may resume after a\nhuman action) and not active (no automatic progress is being made). Pollers\nshould treat it as stop-and-review rather than keep waiting for a terminal\nstatus. It is intentionally in neither ``is_terminal`` nor ``is_active``.",
      "enum": [
        "pending",
        "queued",
        "running",
        "awaiting_review",
        "completed",
        "completed_with_errors",
        "failed",
        "cancelled"
      ],
      "title": "JobStatus",
      "type": "string"
    },
    "LengthSpec": {
      "additionalProperties": false,
      "description": "How closely the article must meet the brief's target word count.",
      "properties": {
        "requirement": {
          "$ref": "#/$defs/ElementRequirement",
          "default": "optional"
        },
        "tolerance_pct": {
          "default": 20,
          "maximum": 50,
          "minimum": 5,
          "title": "Tolerance Pct",
          "type": "integer"
        }
      },
      "title": "LengthSpec",
      "type": "object"
    },
    "ProductSpec": {
      "additionalProperties": false,
      "description": "A product the article should name.",
      "properties": {
        "name": {
          "maxLength": 80,
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "requirement": {
          "$ref": "#/$defs/ElementRequirement",
          "default": "optional"
        },
        "usage": {
          "default": "",
          "maxLength": 200,
          "title": "Usage",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "ProductSpec",
      "type": "object"
    },
    "PublicBriefFact": {
      "description": "A supplied fact on a brief (response). ``claim_id`` is the id the\nfact carries in the content kit's claims.",
      "properties": {
        "attribution": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Attribution"
        },
        "claim_id": {
          "title": "Claim Id",
          "type": "string"
        },
        "priority": {
          "$ref": "#/$defs/UserFactPriority",
          "default": "normal"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url"
        },
        "text": {
          "title": "Text",
          "type": "string"
        }
      },
      "required": [
        "claim_id",
        "text"
      ],
      "title": "PublicBriefFact",
      "type": "object"
    },
    "PublicContentSummary": {
      "description": "A content item in list form (no body).",
      "properties": {
        "author_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author Id"
        },
        "brand_id": {
          "format": "uuid",
          "title": "Brand Id",
          "type": "string"
        },
        "brief_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brief Id"
        },
        "created_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "failed_draft_archived_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Archived after 30 days with no saved version. Restore this item by ID to list it again.",
          "title": "Failed Draft Archived At"
        },
        "format": {
          "$ref": "#/$defs/ContentFormat"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "latest_attempt": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicJobSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "latest_version": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicContentVersionSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "pillar_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pillar Id"
        },
        "property_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Id"
        },
        "published_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Published Url"
        },
        "slug": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Slug"
        },
        "source_topic_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Topic Id"
        },
        "status": {
          "$ref": "#/$defs/TaskStatus"
        },
        "title": {
          "title": "Title",
          "type": "string"
        },
        "updated_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        },
        "version_count": {
          "default": 0,
          "minimum": 0,
          "title": "Version Count",
          "type": "integer"
        }
      },
      "required": [
        "id",
        "brand_id",
        "title",
        "status",
        "format"
      ],
      "title": "PublicContentSummary",
      "type": "object"
    },
    "PublicContentVersionSummary": {
      "description": "Actual saved revision; null on the item when no revision exists.",
      "properties": {
        "brief_version_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brief Version Id"
        },
        "created_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "producing_job": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicJobSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "version_number": {
          "title": "Version Number",
          "type": "integer"
        },
        "word_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Word Count"
        }
      },
      "required": [
        "id",
        "version_number"
      ],
      "title": "PublicContentVersionSummary",
      "type": "object"
    },
    "PublicJobSummary": {
      "description": "Persisted, organization-scoped recovery state without internal payloads.",
      "properties": {
        "brand_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brand Id"
        },
        "brief_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Brief Id"
        },
        "content_item_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Item Id"
        },
        "content_version_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Version Id"
        },
        "created_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "elapsed_seconds": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Elapsed Seconds"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "error_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error Type"
        },
        "finished_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finished At"
        },
        "job_id": {
          "format": "uuid",
          "title": "Job Id",
          "type": "string"
        },
        "property_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Property Id"
        },
        "queued_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Queued At"
        },
        "started_at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At"
        },
        "status": {
          "$ref": "#/$defs/JobStatus"
        },
        "type": {
          "description": "Stored job-type name, preserved verbatim including retired types.",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "job_id",
        "type",
        "status"
      ],
      "title": "PublicJobSummary",
      "type": "object"
    },
    "PublicPage_PublicContentSummary_": {
      "properties": {
        "has_more": {
          "default": false,
          "title": "Has More",
          "type": "boolean"
        },
        "items": {
          "items": {
            "$ref": "#/$defs/PublicContentSummary"
          },
          "title": "Items",
          "type": "array"
        },
        "limit": {
          "title": "Limit",
          "type": "integer"
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Opaque keyset cursor for the next page when the endpoint supports cursor paging. Prefer this over offset for multi-page walks.",
          "title": "Next Cursor"
        },
        "offset": {
          "title": "Offset",
          "type": "integer"
        },
        "total": {
          "default": 0,
          "title": "Total",
          "type": "integer"
        }
      },
      "required": [
        "limit",
        "offset"
      ],
      "title": "PublicPage[PublicContentSummary]",
      "type": "object"
    },
    "ReadingLevelSpec": {
      "additionalProperties": false,
      "description": "The reader level the article targets. No level: not judged.",
      "properties": {
        "level": {
          "anyOf": [
            {
              "$ref": "#/$defs/ArticleReadingLevel"
            },
            {
              "type": "null"
            }
          ]
        },
        "requirement": {
          "$ref": "#/$defs/ElementRequirement",
          "default": "optional"
        }
      },
      "title": "ReadingLevelSpec",
      "type": "object"
    },
    "RelevantLinkSpec": {
      "additionalProperties": false,
      "description": "A navigation link the article should carry (not a citation).",
      "properties": {
        "anchor": {
          "maxLength": 80,
          "minLength": 1,
          "title": "Anchor",
          "type": "string"
        },
        "id": {
          "description": "Lowercase slug that identifies the link in the spec.",
          "maxLength": 64,
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
          "title": "Id",
          "type": "string"
        },
        "requirement": {
          "$ref": "#/$defs/ElementRequirement",
          "default": "optional"
        },
        "url": {
          "title": "Url",
          "type": "string"
        },
        "usage": {
          "default": "",
          "maxLength": 200,
          "title": "Usage",
          "type": "string"
        }
      },
      "required": [
        "id",
        "url",
        "anchor"
      ],
      "title": "RelevantLinkSpec",
      "type": "object"
    },
    "SearchIntent": {
      "description": "User intent classification for SEO.",
      "enum": [
        "informational",
        "navigational",
        "transactional",
        "commercial"
      ],
      "title": "SearchIntent",
      "type": "string"
    },
    "StatsSpec": {
      "additionalProperties": false,
      "description": "How many stats a required stats element needs.",
      "properties": {
        "min_items": {
          "default": 1,
          "maximum": 10,
          "minimum": 1,
          "title": "Min Items",
          "type": "integer"
        }
      },
      "title": "StatsSpec",
      "type": "object"
    },
    "TaskStatus": {
      "description": "Workflow status of content tasks.",
      "enum": [
        "planned",
        "ready",
        "generating",
        "draft",
        "in_review",
        "approved",
        "published",
        "cancelled"
      ],
      "title": "TaskStatus",
      "type": "string"
    },
    "UserFactPriority": {
      "enum": [
        "normal",
        "must_use"
      ],
      "title": "UserFactPriority",
      "type": "string"
    },
    "VoiceSpec": {
      "additionalProperties": false,
      "description": "Up to two voice lines added to the brand voice for this article.",
      "properties": {
        "extra_rules": {
          "items": {
            "type": "string"
          },
          "maxItems": 2,
          "title": "Extra Rules",
          "type": "array"
        },
        "requirement": {
          "$ref": "#/$defs/ElementRequirement",
          "default": "optional"
        }
      },
      "title": "VoiceSpec",
      "type": "object"
    }
  }
}