NextSchoolNextSchool Data API

Home Visit (Care Module)

Home visit records — list, stats, and nested latest visit on Student

Home Visit

Home visits capture a teacher's in-person observation of a student's household across several info sections (basic condition, observation, personal/family context, transport, misc, and visitor opinion), plus attached files and relatives.

All queries require authentication and are school-scoped. The surface is read-only — this API exposes only visit reads. Visits are captured through the care application.

Overall Classification

Every student resolves to one of these values:

ValueRule
NOT_VISITEDNo visit record exists for the student in scope
PROBLEMA visit exists and at least one of 12 risk flags is set
NORMALA visit exists and no risk flags are set

The 12 risk flags come from the visitor's opinion section: studyAssist, abilityAssist, mentalAssist, physicalAssist, securityAssist, drugAssist, houseAssist, drug, violence, sexual, game, electronic.

List Students

Deduped per student (prefers the row with a visit attached).

query {
  visitStudents(classroomId: 42, status: "problem", limit: 50) {
    studentId
    code
    title
    firstname
    lastname
    classroomName
    orderNumber
    visitId
    visitedAt
    overall         # NOT_VISITED | NORMAL | PROBLEM
    overallText     # "ยังไม่เยี่ยม" | "ปกติ" | "มีปัญหา"
  }
}

Parameters

ParameterTypeDefaultDescription
academicYearIdIntactive yearScope to a specific academic year
semesterIdIntScope to a single semester (overrides academicYearId)
classroomIdIntFilter to one classroom
statusStringallvisited | not_visited | problem | normal | all
limitInt50Maximum rows
offsetInt0Skip rows

Aggregate Stats

query {
  visitStats {
    total
    visited
    notVisited
    problem
    normal
  }
}

Latest Visit (nested on Student)

query {
  student(id: 12345) {
    id
    fullName
    classroomName
    visit {
      id
      overall
      overallText
      visitedAt
      infoBasic {
        homeConditionEnv
        homeCondition
        familyRelationship
        familySupport
        remark
      }
      infoObservation {
        sibling
        rank
        son
        daughter
      }
      infoPersonal {
        homeKind
        liveWith
        maritalStatus
        income
        job
      }
      infoTransport {
        distance
        method
        isSafe
        duration
      }
      infoMisc {
        studySupport
        behaviorCare
        badThings
        sickness
        disability
      }
      infoOpinion {
        studyAssist
        drug
        violence
        electronic
        remark
      }
      problemFlags {
        studyAssist
        drug
        violence
        game
        electronic
        anyFlag
      }
      relatives {
        id
        relativeType
        title
        firstname
        lastname
        occupation
      }
      files {
        id
        path
        kind
      }
    }
  }
}

Student.visit

ArgumentTypeDescription
semesterIdIntOptional. When omitted, returns the most recent visit across all semesters.

Returns Visit (nullable) — null if the student has never been visited. All info* sub-sections are nullable because different schools configure different sections.

Errors

CodeCause
UNAUTHENTICATEDNo valid JWT or API key
FORBIDDENJWT has no schoolId
NOT_FOUNDStudent not found in your school

On this page