{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/markmesh-com/json-schema/markmesh-com-filing-schema.json",
  "title": "filing",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/markmesh-com-openapi.json#/components/schemas/filing",
  "additionalProperties": false,
  "properties": {
    "attributes": {
      "additionalProperties": false,
      "description": "An attributes object for a filing.",
      "properties": {
        "application_number": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Official application number assigned by the trademark office."
        },
        "notes": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Internal notes about the case."
        },
        "representative_name": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Representative/agent name — office snapshot for agent-driven workflows. Derived from `representative_names`."
        },
        "filing_date": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date the case was filed with the trademark office."
        },
        "owner_name": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Trademark holder/applicant name — office snapshot, not internal client data. Derived from `owner_names` (joined with `; `) for back-compat."
        },
        "registration_date": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date the trademark was officially registered."
        },
        "publication_number": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Official publication number (if published)."
        },
        "official_status": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Status code/text as reported by the trademark office."
        },
        "description": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Free-text figurative description of the mark (INID 571). Nil when the office doesn't provide one."
        },
        "colour_claim_text": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Free-text colour claim (INID 591) — the office's narrative of which colours are claimed. Nil when not provided."
        },
        "vienna_classes": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Vienna classification codes for the mark (figurative elements). Empty list when the office doesn't return any."
        },
        "renewal_date": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date of last renewal as reported by office."
        },
        "status": {
          "description": "Current lifecycle status: draft (not yet filed), filed, published (opposition period), opposed, registered, abandoned, or expired.",
          "enum": [
            "draft",
            "filed",
            "published",
            "registered",
            "abandoned",
            "expired"
          ],
          "type": "string"
        },
        "transliteration": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Transliterations / phonetic readings of the mark, as provided by the office. Empty list when the office doesn't return any."
        },
        "representative_names": {
          "description": "B-412: canonical list of representative/agent names. Same shape + semantics as `owner_names`.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "status_since": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date the current `status` was first applied (office-reported)."
        },
        "owner_names": {
          "description": "B-412: canonical list of holder/applicant names. When the office exposes joint owners, this carries every name; `owner_name` is the joined single-string view.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "provenance": {
          "anyOf": [
            {
              "type": [
                "object",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Which office this row came from, when it was last reconciled, and a citable office URL."
        },
        "colour_claim": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Free-text colour claim for the mark, as provided by the office. Nil when no colour claim is registered."
        },
        "registration_number": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Official registration number (if registered)."
        },
        "renewal_status": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Renewal status as reported by office (e.g. RENEWED, NOT_RENEWED)."
        },
        "closed_reason": {
          "anyOf": [
            {
              "enum": [
                "manual",
                "organization_closed",
                "gdpr_request",
                "billing_enforcement",
                "system_cleanup"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Why the filing was closed; drives selective restore on Organization.reopen."
        },
        "madrid_designations": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Madrid Protocol designations (ISO-2 country codes) for an international registration. Empty for non-Madrid filings."
        },
        "retention_status": {
          "anyOf": [
            {
              "enum": [
                "active",
                "closed"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Retention status: :active (default) or :closed (soft-deleted, hidden from sync/lists)."
        },
        "ncl_edition": {
          "description": "Nice Classification edition this filing was created under (e.g. '13-2026').",
          "type": "string"
        },
        "expiry_date": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date when the registration expires and needs renewal."
        },
        "mark_text": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Verbatim mark text from office — immutable snapshot, not synced from trademark.name."
        },
        "publication_date": {
          "anyOf": [
            {
              "format": "date",
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date the case was published for opposition."
        },
        "mark_type": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Mark classification as reported by office (word, figurative, combined, three_dimensional, sound, other)."
        },
        "filing_type": {
          "anyOf": [
            {
              "enum": [
                "national",
                "regional",
                "madrid_ir"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Type of filing:\n  :national  — single-country filing at a national office (default)\n  :regional  — multi-country regional filing (EUIPO, BOIP, etc.)\n  :madrid_ir — Madrid Protocol International Registration at WIPO; designated countries are tracked via `madrid_designations`."
        },
        "internal_reference": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Organization's internal case reference number."
        },
        "basic_application": {
          "anyOf": [
            {
              "type": [
                "object",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Madrid Protocol INID 821 — home-office application snapshot the IR cites as its base. Nil for non-Madrid filings."
        },
        "applicant_reference": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Reference assigned by the applicant or their agent (office-reported)."
        },
        "priority_claims": {
          "anyOf": [
            {
              "type": [
                "object",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Office-provided priority claim data — structured snapshot, not a fachlich normalized model."
        },
        "basic_registration": {
          "anyOf": [
            {
              "type": [
                "object",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Madrid Protocol INID 822 — home-office registration snapshot the IR cites as its base. Nil for non-Madrid filings."
        }
      },
      "required": [
        "status",
        "ncl_edition",
        "owner_names",
        "representative_names"
      ],
      "type": "object"
    },
    "id": {
      "description": "Resource UUID.",
      "format": "uuid",
      "type": "string"
    },
    "relationships": {
      "additionalProperties": false,
      "description": "A relationships object for a filing.",
      "properties": {
        "events": {
          "properties": {
            "data": {
              "description": "Relationship data for events.",
              "items": {
                "additionalProperties": false,
                "description": "Resource identifiers for events",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "meta": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "type": "object"
              },
              "type": "array",
              "uniqueItems": true
            }
          }
        },
        "filing_classes": {
          "properties": {
            "data": {
              "description": "Relationship data for filing_classes.",
              "items": {
                "additionalProperties": false,
                "description": "Resource identifiers for filing_classes",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "meta": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id"
                ],
                "type": "object"
              },
              "type": "array",
              "uniqueItems": true
            }
          }
        }
      },
      "type": "object"
    },
    "type": {
      "description": "JSON:API resource type. Always `\"filing\"`.",
      "enum": [
        "filing"
      ],
      "type": "string"
    }
  },
  "required": [
    "type",
    "id"
  ],
  "type": "object"
}