update_hike
Edit a hike.
/v1/hikes/{hikeId}Only sent fields change. Strings clear on empty string; the difficulty, the figures, the gear list and the line clear on null; arrays are full replacements.
curl -X PATCH "https://sceniq.earth/api/v1/hikes/kx7q3e5s7c9h1n3m5e7r9s1t3v5w7y9a" \
-H "Authorization: Bearer $SCENIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"durationMin": 180,
"gainM": 450,
"descentM": 450
}'Path parameters
- hikeIdstring · hike idrequired
Id of the hike (from
list_hikes).
Body parameters
- descentMnumber or nulloptional
Descent in meters, 0 or more. Never derived from
gainM: give it when the source does. null clears. - descriptionstringoptional
The hike in the creator's words, shown on the hike card. Empty string clears.
- difficultystring or nulloptional
One of four words: easy, moderate, hard or expert. Buyers read it before the grade (Moderate · T2), and the easiest hike of a spot fills its Accessibility. null clears.
easymoderatehardexpert - distanceKmnumber or nulloptional
Distance in kilometers, 0 or more. null clears.
- durationMinnumber or nulloptional
Walking time in minutes, 0 or more, as the creator or the trail page gives it. null clears.
- equipmentarray of strings or nulloptional
Gear, full replacement, at most 50 items; [] means explicitly no special gear (shown as None), null clears back to unknown.
- gainMnumber or nulloptional
Elevation gain in meters, 0 or more. null clears.
- gradestringoptional
The technical grade as the creator or the trail page writes it, at most 24 characters: T2 (SAC hiking), K3 (via ferrata), Class 3 (US), EE (Italy). Optional; empty string clears.
- namestringoptional
Hike name, e.g. Oeschinensee panorama loop or Fairy Falls trail. Without one the apps show Hike from <start>, or Hike N when there is no start either. Empty string clears.
- sourcesarray of stringsoptional
Where the facts come from, full replacement ([] clears), at most 25 entries: links to official trail pages or plain text (the creator's GPX). Buyers see them under Sources, links by their host.
- startstringoptional
Trailhead or starting point in words. Empty string clears.
- startMapsUrlstringoptional
Map link to the trailhead: https on Google Maps, Apple Maps, Swisstopo, OpenStreetMap or SchweizMobil, or a geo: URI. Empty string clears.
The hike's line (see
create_hike), replaced whole; null removes it.Show 3 fieldsHide fieldsof HikeTrack
- coordinatesarray of array of numbersrequired
Positions as [lon, lat] or [lon, lat, ele] (ele in meters), 2 to 1,000. Stored rounded to 6 decimals and whole meters.
- sourcestringoptional
The file type the line came from: gpx or kml. Other values are dropped.
- fileNamestringoptional
The imported file's name, cut to 200 characters.
Transit notes shown under Transit on the hike card, full replacement ([] clears), at most 20: [{ mode: train|bus|
cable_car|car|boat|ferry|plane, note }]. Rows with an empty note are dropped.Show 2 fieldsHide fieldsof TransitNote
- modestringrequired
train, bus,
cable_car, car, boat, ferry or plane (shown as Flight).trainbuscable_carcarboatferryplane - notestringrequired
The note in words: the connection, where to change, the last departure.
Returns
200 OK with this object.
- okbooleanrequired
Always true: the write went through.
Always
true - hikeIdstring · hike idrequired
The hike's id.
{
"ok": true,
"hikeId": "kx7q3e5s7c9h1n3m5e7r9s1t3v5w7y9a"
}Errors
Every error is { error: { code, message } }. Act on the code.
- 400invalid_argumentA required field is missing, a field is unknown, or a value does not match its type (the Convex validator's path and value are in the message).
- 400invalid_requestA writer refused a value: a map link on a host that is not allowed, a title that is too long, a date that does not exist, too many items in a list. The message is the writer's own sentence.
- 401unauthenticatedThe request carries no key. Send it as Authorization: Bearer sk_sceniq_... (or X-Api-Key).
- 401invalid_api_keyThe key is unknown, revoked or expired.
- 403api_scope_requiredA read-only key called a write operation, or a key without the publish option called publish_changes.
- 403forbiddenThe key belongs to a creator account that is no longer active.
- 404not_foundThe id does not exist or belongs to another creator. The two answers are identical on purpose, so ids never reveal what exists.
- 413payload_too_largeA JSON body over 2 MB, an image over 6 MB, a batch upload over 19 MB, or an MCP message over 2 MB.
- 429rate_limitedOver a limit: requests per key per minute, per creator per hour, uploads per key per minute, or check_links per guide per hour.
- 500internal_errorAn unexpected failure. The message is hidden on purpose.