{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-contact-view-schema.json",
  "title": "ContactView",
  "description": "Public projection of a [`Contact`] (omits `unsubscribe_token`).",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-openapi.json#/components/schemas/ContactView",
  "type": "object",
  "required": [
    "id",
    "type",
    "country",
    "reminder_opt_out",
    "source",
    "tags",
    "marketing_consent",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "address": {
      "type": [
        "string",
        "null"
      ],
      "description": "Street address."
    },
    "archived_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 archival timestamp, or `null` when the contact is active."
    },
    "city": {
      "type": [
        "string",
        "null"
      ],
      "description": "City."
    },
    "company": {
      "type": [
        "string",
        "null"
      ],
      "description": "Company / legal name (business)."
    },
    "consent_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 instant consent was last granted, or `null`."
    },
    "consent_source": {
      "type": [
        "string",
        "null"
      ],
      "description": "Provenance of the recorded consent, or `null`."
    },
    "country": {
      "type": "string",
      "description": "ISO 3166-1 alpha-2 country code."
    },
    "created_at": {
      "type": "string",
      "description": "RFC3339 creation timestamp."
    },
    "default_discount_terms": {
      "type": [
        "string",
        "null"
      ],
      "description": "Per-contact default early-payment discount terms pre-filling a new\nquote/invoice, or `null` to fall back to the org default."
    },
    "default_payment_terms": {
      "type": [
        "string",
        "null"
      ],
      "description": "Per-contact default payment terms pre-filling a new quote/invoice,\nor `null` to fall back to the org default."
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "description": "Contact email."
    },
    "erased_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 RGPD-erasure timestamp, or `null` when not erased."
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Given name (individual)."
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Stable identifier."
    },
    "last_interaction_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 timestamp of the last recorded interaction (chat reply,\nemail, …), or `null` when none."
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Family name (individual)."
    },
    "lead_score": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "Lead score in `[0..=100]`, or `null` for a non-lead."
    },
    "lead_status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Lead pipeline stage, or `null` for a non-lead."
    },
    "legal_basis": {
      "type": [
        "string",
        "null"
      ],
      "description": "RGPD lawful basis (`consent`/`contract`/`legitimate_interest`/\n`legal_obligation`), or `null`."
    },
    "marketing_consent": {
      "type": "boolean",
      "description": "Current marketing-consent state."
    },
    "merged_into": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Surviving contact this row was merged into (`null` for a live contact)."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-form notes."
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "Phone number."
    },
    "postal_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Postal / ZIP code."
    },
    "preferred_language": {
      "type": [
        "string",
        "null"
      ],
      "description": "Preferred language (`fr` or `en`) for outbound emails and documents,\nor `null` when no explicit preference."
    },
    "reminder_opt_out": {
      "type": "boolean",
      "description": "Whether the contact opted out of reminder emails."
    },
    "siret": {
      "type": [
        "string",
        "null"
      ],
      "description": "French business registration number (14 digits)."
    },
    "source": {
      "type": "string",
      "description": "Acquisition source (`manual`/`chat`/`import`/`api`)."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Assigned tags (empty when none)."
    },
    "type": {
      "type": "string",
      "description": "`particulier` or `professionnel`."
    },
    "updated_at": {
      "type": "string",
      "description": "RFC3339 last-update timestamp."
    },
    "vat_intra": {
      "type": [
        "string",
        "null"
      ],
      "description": "Intra-EU VAT number (e.g. `FR12345678901`)."
    }
  }
}