Update Horse
curl --request PUT \
--url https://api.example.com/api/horses/:id \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"age": 123,
"breed": "<string>",
"discipline": "<string>",
"pedigree": "<string>",
"location": {
"country": "<string>",
"region": "<string>",
"city": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
}
},
"price": 123,
"currency": "<string>",
"photos": [
{
"url": "<string>",
"caption": "<string>",
"is_cover": true
}
],
"videos": [
{
"url": "<string>",
"video_type": "<string>",
"title": "<string>",
"description": "<string>",
"recorded_at": "<string>"
}
],
"status": "<string>"
}
'import requests
url = "https://api.example.com/api/horses/:id"
payload = {
"name": "<string>",
"age": 123,
"breed": "<string>",
"discipline": "<string>",
"pedigree": "<string>",
"location": {
"country": "<string>",
"region": "<string>",
"city": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
}
},
"price": 123,
"currency": "<string>",
"photos": [
{
"url": "<string>",
"caption": "<string>",
"is_cover": True
}
],
"videos": [
{
"url": "<string>",
"video_type": "<string>",
"title": "<string>",
"description": "<string>",
"recorded_at": "<string>"
}
],
"status": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
age: 123,
breed: '<string>',
discipline: '<string>',
pedigree: '<string>',
location: {
country: '<string>',
region: '<string>',
city: '<string>',
coordinates: {lat: 123, lng: 123}
},
price: 123,
currency: '<string>',
photos: [{url: '<string>', caption: '<string>', is_cover: true}],
videos: [
{
url: '<string>',
video_type: '<string>',
title: '<string>',
description: '<string>',
recorded_at: '<string>'
}
],
status: '<string>'
})
};
fetch('https://api.example.com/api/horses/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/horses/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'age' => 123,
'breed' => '<string>',
'discipline' => '<string>',
'pedigree' => '<string>',
'location' => [
'country' => '<string>',
'region' => '<string>',
'city' => '<string>',
'coordinates' => [
'lat' => 123,
'lng' => 123
]
],
'price' => 123,
'currency' => '<string>',
'photos' => [
[
'url' => '<string>',
'caption' => '<string>',
'is_cover' => true
]
],
'videos' => [
[
'url' => '<string>',
'video_type' => '<string>',
'title' => '<string>',
'description' => '<string>',
'recorded_at' => '<string>'
]
],
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/horses/:id"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/horses/:id")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/horses/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439011",
"seller_id": "507f191e810c19729de860ea",
"name": "Thunder",
"age": 8,
"breed": "Thoroughbred",
"discipline": "Show Jumping",
"pedigree": "Sire: Storm Cat, Dam: Winning Colors",
"location": {
"country": "Argentina",
"region": "Buenos Aires",
"city": "Pilar",
"coordinates": {
"lat": -34.4708,
"lng": -58.5247
}
},
"price": 42000,
"currency": "USD",
"photos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j1",
"url": "https://cdn.horsetrust.com/photos/abc123.jpg",
"caption": "Thunder at competition",
"is_cover": true,
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"videos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j2",
"url": "https://youtube.com/watch?v=abc123",
"embed_url": "https://www.youtube.com/embed/abc123",
"video_type": "competition",
"title": "Thunder jumping 1.40m",
"recorded_at": "2026-02-15T00:00:00Z",
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"status": "active",
"views_count": 235,
"created_at": "2026-03-01T10:00:00Z",
"updated_at": "2026-03-05T15:45:00Z"
}
}
Horses
Update Horse
Update an existing horse listing (owner or admin)
PUT
/
api
/
horses
/
:id
Update Horse
curl --request PUT \
--url https://api.example.com/api/horses/:id \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"age": 123,
"breed": "<string>",
"discipline": "<string>",
"pedigree": "<string>",
"location": {
"country": "<string>",
"region": "<string>",
"city": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
}
},
"price": 123,
"currency": "<string>",
"photos": [
{
"url": "<string>",
"caption": "<string>",
"is_cover": true
}
],
"videos": [
{
"url": "<string>",
"video_type": "<string>",
"title": "<string>",
"description": "<string>",
"recorded_at": "<string>"
}
],
"status": "<string>"
}
'import requests
url = "https://api.example.com/api/horses/:id"
payload = {
"name": "<string>",
"age": 123,
"breed": "<string>",
"discipline": "<string>",
"pedigree": "<string>",
"location": {
"country": "<string>",
"region": "<string>",
"city": "<string>",
"coordinates": {
"lat": 123,
"lng": 123
}
},
"price": 123,
"currency": "<string>",
"photos": [
{
"url": "<string>",
"caption": "<string>",
"is_cover": True
}
],
"videos": [
{
"url": "<string>",
"video_type": "<string>",
"title": "<string>",
"description": "<string>",
"recorded_at": "<string>"
}
],
"status": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
age: 123,
breed: '<string>',
discipline: '<string>',
pedigree: '<string>',
location: {
country: '<string>',
region: '<string>',
city: '<string>',
coordinates: {lat: 123, lng: 123}
},
price: 123,
currency: '<string>',
photos: [{url: '<string>', caption: '<string>', is_cover: true}],
videos: [
{
url: '<string>',
video_type: '<string>',
title: '<string>',
description: '<string>',
recorded_at: '<string>'
}
],
status: '<string>'
})
};
fetch('https://api.example.com/api/horses/:id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/horses/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'age' => 123,
'breed' => '<string>',
'discipline' => '<string>',
'pedigree' => '<string>',
'location' => [
'country' => '<string>',
'region' => '<string>',
'city' => '<string>',
'coordinates' => [
'lat' => 123,
'lng' => 123
]
],
'price' => 123,
'currency' => '<string>',
'photos' => [
[
'url' => '<string>',
'caption' => '<string>',
'is_cover' => true
]
],
'videos' => [
[
'url' => '<string>',
'video_type' => '<string>',
'title' => '<string>',
'description' => '<string>',
'recorded_at' => '<string>'
]
],
'status' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/horses/:id"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/horses/:id")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/horses/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"age\": 123,\n \"breed\": \"<string>\",\n \"discipline\": \"<string>\",\n \"pedigree\": \"<string>\",\n \"location\": {\n \"country\": \"<string>\",\n \"region\": \"<string>\",\n \"city\": \"<string>\",\n \"coordinates\": {\n \"lat\": 123,\n \"lng\": 123\n }\n },\n \"price\": 123,\n \"currency\": \"<string>\",\n \"photos\": [\n {\n \"url\": \"<string>\",\n \"caption\": \"<string>\",\n \"is_cover\": true\n }\n ],\n \"videos\": [\n {\n \"url\": \"<string>\",\n \"video_type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"recorded_at\": \"<string>\"\n }\n ],\n \"status\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439011",
"seller_id": "507f191e810c19729de860ea",
"name": "Thunder",
"age": 8,
"breed": "Thoroughbred",
"discipline": "Show Jumping",
"pedigree": "Sire: Storm Cat, Dam: Winning Colors",
"location": {
"country": "Argentina",
"region": "Buenos Aires",
"city": "Pilar",
"coordinates": {
"lat": -34.4708,
"lng": -58.5247
}
},
"price": 42000,
"currency": "USD",
"photos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j1",
"url": "https://cdn.horsetrust.com/photos/abc123.jpg",
"caption": "Thunder at competition",
"is_cover": true,
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"videos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j2",
"url": "https://youtube.com/watch?v=abc123",
"embed_url": "https://www.youtube.com/embed/abc123",
"video_type": "competition",
"title": "Thunder jumping 1.40m",
"recorded_at": "2026-02-15T00:00:00Z",
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"status": "active",
"views_count": 235,
"created_at": "2026-03-01T10:00:00Z",
"updated_at": "2026-03-05T15:45:00Z"
}
}
Authentication
Required - JWT Bearer token withseller or admin role
Authorization: Bearer YOUR_JWT_TOKEN
Authorization
- Sellers can only update their own listings
- Admins can update any listing
Path Parameters
string
required
Horse unique identifier (MongoDB ObjectId)
Request Body
All fields are optional - only include fields you want to update.string
Horse name (trimmed)
number
Horse age in years (0-40)
string
Horse breed (trimmed)
string
Primary discipline (trimmed)
string
Pedigree information
object
number
Listing price (minimum: 0)
string
Currency code: USD, EUR, ARS, BRL, MXN
array
array
string
Listing status: active, sold, paused, draft
Response
boolean
Indicates if the request was successful
object
Updated horse listing with all fields
string
Horse unique identifier
string
Seller ID
string
Horse name
number
Horse age
string
Horse breed
string
Primary discipline
string
Pedigree information
object
Location details
number
Listing price
string
Currency code
array
Array of photos
array
Array of videos with auto-generated embed_url
string
Listing status
number
View count
string
Creation timestamp
string
Last update timestamp (updated)
Notes
- Only provide fields you want to update (partial update)
- Validators run on update, ensuring data integrity
- Video
embed_urlis auto-regenerated for YouTube/Vimeo URLs updated_attimestamp is automatically updated- Cannot change
seller_idorviews_countvia this endpoint
Examples
curl -X PUT "https://api.horsetrust.com/api/horses/507f1f77bcf86cd799439011" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"price": 42000,
"status": "active",
"location": {
"country": "Argentina",
"region": "Buenos Aires",
"city": "Pilar"
}
}'
const horseId = '507f1f77bcf86cd799439011';
const response = await fetch(`https://api.horsetrust.com/api/horses/${horseId}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_JWT_TOKEN'
},
body: JSON.stringify({
price: 42000,
status: 'active',
location: {
country: 'Argentina',
region: 'Buenos Aires',
city: 'Pilar'
}
})
});
const data = await response.json();
console.log(data);
import requests
horse_id = '507f1f77bcf86cd799439011'
response = requests.put(
f'https://api.horsetrust.com/api/horses/{horse_id}',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_JWT_TOKEN'
},
json={
'price': 42000,
'status': 'active',
'location': {
'country': 'Argentina',
'region': 'Buenos Aires',
'city': 'Pilar'
}
}
)
data = response.json()
print(data)
{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439011",
"seller_id": "507f191e810c19729de860ea",
"name": "Thunder",
"age": 8,
"breed": "Thoroughbred",
"discipline": "Show Jumping",
"pedigree": "Sire: Storm Cat, Dam: Winning Colors",
"location": {
"country": "Argentina",
"region": "Buenos Aires",
"city": "Pilar",
"coordinates": {
"lat": -34.4708,
"lng": -58.5247
}
},
"price": 42000,
"currency": "USD",
"photos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j1",
"url": "https://cdn.horsetrust.com/photos/abc123.jpg",
"caption": "Thunder at competition",
"is_cover": true,
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"videos": [
{
"_id": "65f1a2b3c4d5e6f7g8h9i0j2",
"url": "https://youtube.com/watch?v=abc123",
"embed_url": "https://www.youtube.com/embed/abc123",
"video_type": "competition",
"title": "Thunder jumping 1.40m",
"recorded_at": "2026-02-15T00:00:00Z",
"uploaded_at": "2026-03-01T10:00:00Z"
}
],
"status": "active",
"views_count": 235,
"created_at": "2026-03-01T10:00:00Z",
"updated_at": "2026-03-05T15:45:00Z"
}
}
Error Responses
400 - Invalid Horse ID
{
"success": false,
"message": "Invalid horse ID"
}
400 - Validation Error
{
"success": false,
"message": "Validation failed: age: Path `age` (50) is more than maximum (40)"
}
401 - Unauthorized
{
"success": false,
"message": "Authentication required"
}
403 - Forbidden
{
"success": false,
"message": "Seller role required"
}
404 - Not Found or Unauthorized
{
"success": false,
"message": "Horse not found or unauthorized"
}
500 - Server Error
{
"success": false,
"message": "Server error"
}
⌘I

