{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reflecto-dev/json-schema/reflecto-dev-sms-contact-query-response-schema.json",
  "title": "SmsContactQueryResponse",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reflecto-dev-openapi.yml#/components/schemas/SmsContactQueryResponse",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "no_match",
        "too_many",
        "disabled",
        "too_many_lookups",
        "no_contacts_permission",
        "no_sms_permission",
        "invalid_query",
        "contacts_unavailable",
        "phone_unreachable"
      ],
      "description": "`ok` carries 1–5 candidates. `no_match` / `too_many` (more than 5 — ask for a more specific name) carry none. `disabled` = the user has not switched on “Let assistants send texts” on the phone. `phone_unreachable` = the phone did not answer within 15 s. The remaining values are phone-side refusals: `too_many_lookups` (30/hour), `no_contacts_permission`, `no_sms_permission`, `invalid_query`, `contacts_unavailable`."
    },
    "candidates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^ch_[A-Za-z0-9_-]{22}$",
            "description": "Opaque, single-use, 10-minute handle minted by the phone. The ONLY way to name a recipient for `POST /v1/sms-agent/sends`."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The contact's display name."
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "The number type (localized, or the contact's custom label). Never a number."
          },
          "recency": {
            "type": "string",
            "enum": [
              "texted today",
              "texted yesterday",
              "texted this week",
              "texted earlier"
            ],
            "description": "Coarse last-texted bucket. Present only to tell apart two candidates with the same name and label. Never a timestamp."
          }
        },
        "required": [
          "handle",
          "name",
          "label"
        ],
        "additionalProperties": false
      },
      "description": "Present only when `status` is `ok`. Never contains a phone number."
    }
  },
  "required": [
    "status"
  ]
}