Skip to main content
GET
/
api
/
horses
/
:id
/
vet-records
Vet Records
curl --request GET \
  --url https://api.example.com/api/horses/:id/vet-records \
  --header 'Content-Type: application/json' \
  --data '
{
  "review_date": "<string>",
  "health_status": "<string>",
  "certificates": [
    {
      "url": "<string>",
      "title": "<string>"
    }
  ],
  "vaccines": [
    {
      "name": "<string>",
      "applied_at": "<string>",
      "next_due_at": "<string>",
      "batch_number": "<string>"
    }
  ],
  "vet_id": "<string>",
  "notes": "<string>"
}
'
{
  "success": true,
  "data": [
    {
      "_id": "65f1a2b3c4d5e6f7g8h9i0j1",
      "horse_id": "507f1f77bcf86cd799439011",
      "vet_id": "507f191e810c19729de860eb",
      "review_date": "2026-02-20T00:00:00Z",
      "health_status": "Excellent condition",
      "certificates": [
        {
          "_id": "65f1a2b3c4d5e6f7g8h9i0j2",
          "url": "https://cdn.horsetrust.com/certs/health_cert.pdf",
          "title": "Health Certificate",
          "uploaded_at": "2026-02-20T10:00:00Z"
        }
      ],
      "vaccines": [
        {
          "name": "Influenza",
          "applied_at": "2026-01-15T00:00:00Z",
          "next_due_at": "2026-07-15T00:00:00Z",
          "batch_number": "FLU2026-A123"
        },
        {
          "name": "Tetanus",
          "applied_at": "2026-01-15T00:00:00Z",
          "next_due_at": "2027-01-15T00:00:00Z",
          "batch_number": "TET2026-B456"
        }
      ],
      "validation_status": "validated",
      "validated_by": "507f191e810c19729de860ec",
      "validated_at": "2026-02-21T14:30:00Z",
      "notes": "Annual check-up completed. Horse in excellent health.",
      "created_at": "2026-02-20T10:00:00Z",
      "updated_at": "2026-02-21T14:30:00Z"
    }
  ]
}

Get Vet Records

Get all validated veterinary records for a horse listing.

Authentication

Not required - Public endpoint

Path Parameters

id
string
required
Horse unique identifier

Response

success
boolean
Indicates if the request was successful
data
array
Array of validated vet records, sorted by review date (newest first)
_id
string
Vet record unique identifier
horse_id
string
Horse ID
vet_id
string
Veterinarian user ID (if applicable)
review_date
string
Date of veterinary review
health_status
string
Overall health status description
certificates
array
Array of certificate documents
_id
string
Certificate ID
url
string
Certificate document URL
title
string
Certificate title
uploaded_at
string
Upload timestamp
vaccines
array
Array of vaccine records
name
string
Vaccine name
applied_at
string
Date vaccine was applied
next_due_at
string
Next vaccine due date
batch_number
string
Vaccine batch number
validation_status
string
Status: validated (only validated records returned)
validated_by
string
User ID of validator
validated_at
string
Validation timestamp
notes
string
Additional notes
created_at
string
Creation timestamp
updated_at
string
Last update timestamp

Example

curl -X GET "https://api.horsetrust.com/api/horses/507f1f77bcf86cd799439011/vet-records"
{
  "success": true,
  "data": [
    {
      "_id": "65f1a2b3c4d5e6f7g8h9i0j1",
      "horse_id": "507f1f77bcf86cd799439011",
      "vet_id": "507f191e810c19729de860eb",
      "review_date": "2026-02-20T00:00:00Z",
      "health_status": "Excellent condition",
      "certificates": [
        {
          "_id": "65f1a2b3c4d5e6f7g8h9i0j2",
          "url": "https://cdn.horsetrust.com/certs/health_cert.pdf",
          "title": "Health Certificate",
          "uploaded_at": "2026-02-20T10:00:00Z"
        }
      ],
      "vaccines": [
        {
          "name": "Influenza",
          "applied_at": "2026-01-15T00:00:00Z",
          "next_due_at": "2026-07-15T00:00:00Z",
          "batch_number": "FLU2026-A123"
        },
        {
          "name": "Tetanus",
          "applied_at": "2026-01-15T00:00:00Z",
          "next_due_at": "2027-01-15T00:00:00Z",
          "batch_number": "TET2026-B456"
        }
      ],
      "validation_status": "validated",
      "validated_by": "507f191e810c19729de860ec",
      "validated_at": "2026-02-21T14:30:00Z",
      "notes": "Annual check-up completed. Horse in excellent health.",
      "created_at": "2026-02-20T10:00:00Z",
      "updated_at": "2026-02-21T14:30:00Z"
    }
  ]
}

Add Vet Record

Add a new veterinary record to a horse listing (owner only).

Authentication

Required - JWT Bearer token with seller or admin role
Authorization: Bearer YOUR_JWT_TOKEN

Authorization

Only the horse owner can add vet records to their listing.

Path Parameters

id
string
required
Horse unique identifier

Request Body

review_date
string
required
Date of veterinary review (ISO 8601 format)
health_status
string
required
Overall health status description
certificates
array
Array of certificate documents
url
string
required
Certificate document URL
title
string
Certificate title/description
vaccines
array
Array of vaccine records
name
string
required
Vaccine name
applied_at
string
required
Date vaccine was applied (ISO 8601)
next_due_at
string
Next vaccine due date (ISO 8601)
batch_number
string
Vaccine batch number
vet_id
string
Veterinarian user ID (if applicable)
notes
string
Additional notes about the health review

Response

success
boolean
Indicates if the request was successful
data
object
Created vet record
_id
string
Vet record unique identifier
horse_id
string
Horse ID
review_date
string
Review date
health_status
string
Health status
certificates
array
Certificates with generated IDs and timestamps
vaccines
array
Vaccine records
validation_status
string
Status: pending (awaits validation)
notes
string
Additional notes
created_at
string
Creation timestamp
updated_at
string
Last update timestamp

Notes

  • New vet records are created with validation_status: "pending"
  • Records must be validated by an admin before appearing in public listings
  • Only the horse owner can add vet records
  • horse_id is automatically set from the URL parameter

Example

curl -X POST "https://api.horsetrust.com/api/horses/507f1f77bcf86cd799439011/vet-record" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "review_date": "2026-03-01T00:00:00Z",
    "health_status": "Excellent condition, ready for competition",
    "certificates": [
      {
        "url": "https://cdn.horsetrust.com/certs/health_2026.pdf",
        "title": "Annual Health Certificate 2026"
      }
    ],
    "vaccines": [
      {
        "name": "Influenza",
        "applied_at": "2026-02-15T00:00:00Z",
        "next_due_at": "2026-08-15T00:00:00Z",
        "batch_number": "FLU2026-C789"
      },
      {
        "name": "Rabies",
        "applied_at": "2026-02-15T00:00:00Z",
        "next_due_at": "2027-02-15T00:00:00Z",
        "batch_number": "RAB2026-D012"
      }
    ],
    "notes": "Annual check-up. All vital signs normal. No issues detected."
  }'
{
  "success": true,
  "data": {
    "_id": "65f1a2b3c4d5e6f7g8h9i0j6",
    "horse_id": "507f1f77bcf86cd799439011",
    "review_date": "2026-03-01T00:00:00Z",
    "health_status": "Excellent condition, ready for competition",
    "certificates": [
      {
        "_id": "65f1a2b3c4d5e6f7g8h9i0j7",
        "url": "https://cdn.horsetrust.com/certs/health_2026.pdf",
        "title": "Annual Health Certificate 2026",
        "uploaded_at": "2026-03-05T16:00:00Z"
      }
    ],
    "vaccines": [
      {
        "name": "Influenza",
        "applied_at": "2026-02-15T00:00:00Z",
        "next_due_at": "2026-08-15T00:00:00Z",
        "batch_number": "FLU2026-C789"
      },
      {
        "name": "Rabies",
        "applied_at": "2026-02-15T00:00:00Z",
        "next_due_at": "2027-02-15T00:00:00Z",
        "batch_number": "RAB2026-D012"
      }
    ],
    "validation_status": "pending",
    "notes": "Annual check-up. All vital signs normal. No issues detected.",
    "created_at": "2026-03-05T16:00:00Z",
    "updated_at": "2026-03-05T16:00:00Z"
  }
}

Error Responses

401 - Unauthorized

{
  "success": false,
  "message": "Authentication required"
}

403 - Forbidden

{
  "success": false,
  "message": "Seller role required"
}

404 - Horse Not Found or Unauthorized

{
  "success": false,
  "message": "Horse not found or unauthorized"
}

500 - Server Error

{
  "success": false,
  "message": "Server error"
}

Build docs developers (and LLMs) love