Skip to main content

Overview

The Visits API allows you to track and manage visitor records for residents. This includes registering visitors, recording arrival and departure times, vehicle information, and visit purposes.

Get All Visits

GET /api/residentvisits
Retrieve all visitor records across all residents. Authorization: Required (Bearer token) Response:
[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "residentId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
    "residentName": "John Smith",
    "visitorName": "Jane Doe",
    "totalPeople": 2,
    "vehicleColor": "Blue",
    "licensePlate": "ABC123",
    "subject": "Family visit",
    "arrivalDate": "2024-03-15T10:00:00Z",
    "departureDate": "2024-03-15T14:30:00Z",
    "createdAt": "2024-03-15T09:45:00Z"
  }
]

Get Visit by ID

GET /api/residentvisits/{id}
Retrieve a specific visit record by its unique identifier. Authorization: Required (Bearer token) Path Parameters:
  • id (guid, required): The unique identifier of the visit record
Response:
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "residentId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
  "residentName": "John Smith",
  "visitorName": "Jane Doe",
  "totalPeople": 2,
  "vehicleColor": "Blue",
  "licensePlate": "ABC123",
  "subject": "Family visit",
  "arrivalDate": "2024-03-15T10:00:00Z",
  "departureDate": "2024-03-15T14:30:00Z",
  "createdAt": "2024-03-15T09:45:00Z"
}
Error Responses:
  • 404 Not Found: Visit record not found

Get Visits by Resident

GET /api/residentvisits/resident/{residentId}
Retrieve all visit records for a specific resident. Authorization: Required (Bearer token) Path Parameters:
  • residentId (guid, required): The unique identifier of the resident
Response: Returns an array of visit objects for the specified resident. Same structure as Get All Visits.

Create Visit

POST /api/residentvisits
Register a new visitor and create a visit record. Authorization: Required (Bearer token) Request Body:
{
  "residentId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
  "visitorName": "Jane Doe",
  "totalPeople": 2,
  "vehicleColor": "Blue",
  "licensePlate": "ABC123",
  "subject": "Family visit",
  "arrivalDate": "2024-03-15T10:00:00Z",
  "departureDate": null
}
Field Validations:
  • residentId (guid, required): ID of the resident being visited
  • visitorName (string, required): Full name of the visitor
  • totalPeople (integer, required): Total number of people in the visiting party
  • vehicleColor (string, optional): Color of the visitor’s vehicle
  • licensePlate (string, optional): License plate number
  • subject (string, required): Purpose or subject of the visit
  • arrivalDate (string, required): ISO date string for arrival time
  • departureDate (string, optional): ISO date string for departure time
Response: Returns the created visit object with 201 Created status.
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "residentId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
  "residentName": "John Smith",
  "visitorName": "Jane Doe",
  "totalPeople": 2,
  "vehicleColor": "Blue",
  "licensePlate": "ABC123",
  "subject": "Family visit",
  "arrivalDate": "2024-03-15T10:00:00Z",
  "departureDate": null,
  "createdAt": "2024-03-15T09:45:00Z"
}
Error Responses:
  • 400 Bad Request: Invalid data or business rule violation (e.g., resident not found)

Update Visit

PUT /api/residentvisits/{id}
Update an existing visit record (e.g., add departure time or update details). Authorization: Required (Bearer token) Path Parameters:
  • id (guid, required): The unique identifier of the visit record to update
Request Body:
{
  "residentId": "7fa85f64-5717-4562-b3fc-2c963f66afa6",
  "visitorName": "Jane Doe",
  "totalPeople": 2,
  "vehicleColor": "Blue",
  "licensePlate": "ABC123",
  "subject": "Family visit",
  "arrivalDate": "2024-03-15T10:00:00Z",
  "departureDate": "2024-03-15T14:30:00Z"
}
Field Validations: Same as Create Visit Response: Returns the updated visit object. Error Responses:
  • 404 Not Found: Visit record not found
  • 400 Bad Request: Invalid data or business rule violation

Delete Visit

DELETE /api/residentvisits/{id}
Remove a visit record from the system. Authorization: Required (Bearer token) Path Parameters:
  • id (guid, required): The unique identifier of the visit record to delete
Response: Returns 204 No Content on successful deletion. Error Responses:
  • 404 Not Found: Visit record not found

Visit Object Schema

FieldTypeDescription
idguidUnique identifier for the visit record
residentIdguidReference to the resident being visited
residentNamestringFull name of the resident (populated from resident data)
visitorNamestringFull name of the visitor
totalPeopleintegerTotal number of people in the visiting party
vehicleColorstringColor of the visitor’s vehicle (optional)
licensePlatestringLicense plate number (optional)
subjectstringPurpose or subject of the visit
arrivalDatestringISO date string for arrival time
departureDatestringISO date string for departure time (null if still visiting)
createdAtstringISO date string for when the record was created

Build docs developers (and LLMs) love