{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/markmesh-com/json-schema/markmesh-com-client-schema.json",
  "title": "client",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/markmesh-com-openapi.json#/components/schemas/client",
  "additionalProperties": false,
  "properties": {
    "attributes": {
      "additionalProperties": false,
      "description": "An attributes object for a client.",
      "properties": {
        "address_1": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Address line 1."
        },
        "address_2": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Address line 2."
        },
        "city": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "City."
        },
        "closed_reason": {
          "anyOf": [
            {
              "enum": [
                "manual",
                "organization_closed",
                "gdpr_request",
                "billing_enforcement",
                "system_cleanup"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Why the client was closed (only populated when `status == :closed`)."
        },
        "contact_email": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Primary contact email address for the client."
        },
        "contact_name": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Primary contact person name."
        },
        "contact_phone": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Primary contact phone number for the client."
        },
        "country": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Country (ISO 3166-1 alpha-2)."
        },
        "external_id": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "External reference ID for billing or CRM integration."
        },
        "name": {
          "description": "Client's full legal name or business name.",
          "type": "string"
        },
        "notes": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Internal notes about the client. Free-form attorney/staff text — marked sensitive because it routinely contains privileged or mandant-specific content."
        },
        "postal_code": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Postal / zip code."
        },
        "state": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "State or province."
        },
        "status": {
          "anyOf": [
            {
              "enum": [
                "active",
                "inactive",
                "closed"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Client lifecycle: active (default), inactive (paused), or closed (soft-deleted)."
        },
        "type": {
          "anyOf": [
            {
              "enum": [
                "individual",
                "company",
                "government",
                "nonprofit",
                "other"
              ],
              "type": [
                "string",
                "null"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Client type: individual, company (default), government, nonprofit, or other."
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "id": {
      "description": "Resource UUID.",
      "format": "uuid",
      "type": "string"
    },
    "type": {
      "description": "JSON:API resource type. Always `\"client\"`.",
      "enum": [
        "client"
      ],
      "type": "string"
    }
  },
  "required": [
    "type",
    "id"
  ],
  "type": "object"
}