Update trail with file upload
POST
/api/v1/trail/form/{id}
const url = 'https://example.com/api/v1/trail/form/example';const form = new FormData();form.append('name', 'example');form.append('description', 'example');form.append('location', 'example');form.append('date', '2026-04-15');form.append('public', 'true');form.append('difficulty', 'easy');form.append('lat', '1');form.append('lon', '1');form.append('distance', '1');form.append('elevation_gain', '1');form.append('elevation_loss', '1');form.append('duration', '1');form.append('photos', 'example');form.append('photos-', 'example');form.append('photos+', 'example');form.append('thumbnail', '1');form.append('like_count', '0');form.append('category', 'example');form.append('tags', 'example');form.append('gpx', 'example');
const options = {method: 'POST'};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/trail/form/example \ --header 'Content-Type: multipart/form-data' \ --form name=example \ --form description=example \ --form location=example \ --form date=2026-04-15 \ --form public=true \ --form difficulty=easy \ --form lat=1 \ --form lon=1 \ --form distance=1 \ --form elevation_gain=1 \ --form elevation_loss=1 \ --form duration=1 \ --form photos=example \ --form photos-=example \ --form 'photos+=example' \ --form thumbnail=1 \ --form like_count=0 \ --form category=example \ --form tags=example \ --form gpx=exampleUpdates a trail with file upload (GPX/photos) and date normalization
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Request Body required
Section titled “Request Body required ” Media type multipart/form-data
object
name
string
description
string
location
string
date
string format: date
public
boolean
difficulty
string
lat
number
lon
number
distance
number
elevation_gain
number
elevation_loss
number
duration
number
photos
Array<string>
photos-
Remove photo by name
string
photos+
Add photo by name
string
thumbnail
integer
like_count
integer
category
string
tags
Array<string>
gpx
string
Responses
Section titled “ Responses ”Trail updated
Media type application/json
object
id
required
Trail ID (15 chars)
string
name
required
Trail name
string
description
string
location
string
author
required
Author user ID
string
date
string format: date
public
required
boolean
difficulty
string
lat
number
lon
number
distance
Distance in meters
number
elevation_gain
Elevation gain in meters
number
elevation_loss
Elevation loss in meters
number
duration
Duration in seconds
number
photos
Array<string>
thumbnail
Index of thumbnail photo
integer
like_count
integer
category
Category ID (15 chars)
string
tags
Array<string>
gpx
GPX file path
string
created
string format: date-time
updated
string format: date-time
Example
{ "difficulty": "easy", "like_count": 0}Bad Request
Not Found
Internal Server Error