{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentline-cloud/json-schema/agentline-cloud-contact-list-schema.json",
  "title": "ContactList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentline-cloud-contacts-api-openapi.yml#/components/schemas/ContactList",
  "properties": {
    "agent_id": {
      "type": "string",
      "title": "Agent Id",
      "description": "Agent whose contacts these are"
    },
    "contacts": {
      "items": {
        "$ref": "#/$defs/ContactOut"
      },
      "type": "array",
      "title": "Contacts",
      "description": "Matching contacts, sorted by name"
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Number of contacts matching the filters, ignoring limit and offset"
    },
    "limit": {
      "type": "integer",
      "title": "Limit",
      "description": "Page size used"
    },
    "offset": {
      "type": "integer",
      "title": "Offset",
      "description": "Offset used"
    }
  },
  "type": "object",
  "required": [
    "agent_id",
    "contacts",
    "total",
    "limit",
    "offset"
  ],
  "$defs": {
    "ContactOut": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique contact identifier (e.g. 'con_abc123')"
        },
        "agent_id": {
          "type": "string",
          "title": "Agent Id",
          "description": "Agent whose contact list this entry belongs to"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Contact name"
        },
        "label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Label",
          "description": "Purpose or relationship"
        },
        "phone_number": {
          "type": "string",
          "title": "Phone Number",
          "description": "Phone number in E.164 format"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At",
          "description": "When the contact was saved"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At",
          "description": "When the contact was last changed"
        }
      },
      "type": "object",
      "required": [
        "id",
        "agent_id",
        "name",
        "phone_number",
        "created_at",
        "updated_at"
      ],
      "title": "ContactOut"
    }
  }
}