{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rusender-ru/json-schema/rusender-ru-contact-upsert-result-dto-schema.json",
  "title": "ContactUpsertResultDto",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rusender-ru-openapi.json#/components/schemas/ContactUpsertResultDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Уникальный идентификатор контакта."
    },
    "email": {
      "type": "string",
      "description": "Email-адрес контакта."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Имя контакта."
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "description": "Телефон контакта."
    },
    "status": {
      "type": "string",
      "enum": [
        "new",
        "active",
        "unsubscribed",
        "unsubscribed_by_us",
        "soft_bounced",
        "hard_bounced",
        "error",
        "complaint"
      ],
      "description": "Статус контакта."
    },
    "listIds": {
      "description": "Идентификаторы списков, к которым принадлежит контакт.",
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "lists": {
      "description": "Списки, к которым принадлежит контакт.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContactListDto"
      }
    },
    "variables": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "Значения переменных (key → value). Присутствует только в контексте списка."
    },
    "createdAt": {
      "type": "string",
      "description": "Дата создания контакта в формате ISO-8601."
    },
    "updatedAt": {
      "type": "string",
      "description": "Дата последнего обновления в формате ISO-8601."
    },
    "lastActivityAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Дата последней активности в формате ISO-8601."
    },
    "dashboardUrl": {
      "type": "string",
      "description": "Прямая ссылка на контакт в дашборде."
    },
    "created": {
      "type": "boolean",
      "description": "true — создан новый контакт; false — найден и переиспользован существующий контакт с тем же email."
    }
  },
  "required": [
    "id",
    "email",
    "status",
    "listIds",
    "createdAt",
    "updatedAt",
    "dashboardUrl",
    "created"
  ],
  "$defs": {
    "ContactListDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Идентификатор списка."
        },
        "name": {
          "type": "string",
          "description": "Название списка."
        }
      },
      "required": [
        "id",
        "name"
      ]
    }
  }
}