Skip to content

API reference

API: Trails

Markdown version

MethodPathWhat it doesScope
GET/v1/data/activities/:tokenA shared activity (its start, end and privacy zones left out) (no sign-in)—
GET/v1/data/commons/:idA Wikimedia Commons photo near a trail (credit it as the trail's commons_photos say) (no sign-in)—
GET/v1/data/lists/:tokenA list of trails someone shared by link (no sign-in)—
GET/v1/data/live/:tokenA live location someone shared with you (no sign-in)—
GET/v1/data/photos/:keyA published trail photo (no sign-in)—
GET/v1/data/placesTowns, ZIP codes and parks whose name starts with what was typed ("boulder", "maplewood, nj", "07040", "rocky mountain"), with where to move the map (a park's box); go is the one place a state or ZIP code made certain (no sign-in)—
GET/v1/data/routes/:tokenA planned route someone shared by link (no sign-in)—
GET/v1/data/statesThe states with trails, and how many each has (no sign-in)—
GET/v1/data/states/:state/downloadEvery trail in a state as one GeoJSON file, under the Open Database License (no sign-in)—
GET/v1/data/states/:state/indexEvery trail in a state: its address, name and when it changed (for the public site's pages and sitemaps) (no sign-in)—
GET/v1/data/trailsTrails in a map area, by name, or near a point, with filters for difficulty, length, climb, activity, route type and dogs (no sign-in)—
GET/v1/data/trails/:idOne trail: its line, elevation profile, length, climb, estimated difficulty and time, trailhead, what is along it, sources and nearby trails (no sign-in)—
GET/v1/data/trails/:id/commonsFree-license photos from Wikimedia Commons taken near a trail, each with its credit (no sign-in)—
GET/v1/data/trails/:id/gpxA trail's line as a GPX file, for a GPS or another app (no sign-in)—
GET/v1/data/trails/:id/reviewsA trail's published reviews, photos and recent conditions, with its average rating (no sign-in)—
GET/v1/data/trails/:id/weatherThe forecast and active alerts at a trail's trailhead (or its middle), from the National Weather Service (no sign-in)—
GET/v1/data/trails/idsOnly the ids of the trails in a map area that the same filters as the list keep, so the map draws only those lines (no sign-in)—
GET/v1/trails/activitiesYour recorded and imported activities, newest firsttrails:read
POST/v1/trails/activitiesSave a recorded activity (the track packed by the app); safe to retry with the same client_idtrails:write
DELETE/v1/trails/activities/:idDelete an activity for goodtrails:write
GET/v1/trails/activities/:idOne activity: its line, elevation and numberstrails:read
PATCH/v1/trails/activities/:idRename an activity, change its kind, or share it (private, anyone with the link, or public)trails:write
GET/v1/trails/activities/:id/exportAn activity as GeoJSON (for maps) or CSV (a row a point, for a spreadsheet)trails:read
GET/v1/trails/activities/:id/gpxAn activity as a GPX file, every point (it's yours)trails:read
POST/v1/trails/activities/importImport an activity from a GPX file's text or a FIT file (base64), as watches and other apps export themtrails:write
GET/v1/trails/listsYour saved lists, with how many trails each holdstrails:read
POST/v1/trails/listsMake a new listtrails:write
DELETE/v1/trails/lists/:idDelete a list (the trails stay on the map)trails:write
GET/v1/trails/lists/:idOne list and its trails (yours, or one shared with your account)trails:read
PATCH/v1/trails/lists/:idRename a list, share it by link, or share it with everyone in your accounttrails:write
PUT/v1/trails/lists/orderPut your lists in this order (Want to go stays first)trails:write
GET/v1/trails/liveYour live shares, newest firsttrails:read
POST/v1/trails/liveStart sharing where you are (a link you send yourself; optional due-back time and up to 3 email contacts)trails:write
PATCH/v1/trails/live/:idChange a running share's due-back time or contacts (the link stays the same)trails:write
POST/v1/trails/live/:id/endEnd a live share (I'm back): the link stops showing where you aretrails:write
PUT/v1/trails/live/:id/positionWhere you are now, for a running share (only the latest is kept)trails:write
GET/v1/trails/photos/:keyOne of your photos, published or nottrails:read
POST/v1/trails/planA route through points, along the trails between them where it can (a preview: nothing is saved)trails:read
GET/v1/trails/plusWhich Plus features your account has (all, until paid plans open)trails:read
GET/v1/trails/privacy-zonesYour privacy zonestrails:read
POST/v1/trails/privacy-zonesAdd a privacy zone (a circle 200 m to 1.6 km across the middle of it)trails:write
DELETE/v1/trails/privacy-zones/:idRemove a privacy zonetrails:write
POST/v1/trails/reportsReport a review, photo or condition to our moderatorstrails:write
DELETE/v1/trails/review-photos/:idDelete one of your photostrails:write
DELETE/v1/trails/reviews/:trail_idDelete your review of a trail, with its photostrails:write
GET/v1/trails/reviews/:trail_idYour review of a trail, whatever its status (null when you haven't written one)trails:read
PUT/v1/trails/reviews/:trail_idWrite or change your review of a trail (stars, words, when you went, and what it was like)trails:write
POST/v1/trails/reviews/:trail_id/photosAdd a photo to your review (JPEG, PNG or WebP, base64; its location and camera data are removed)trails:write
GET/v1/trails/routesYour planned routes, newest firsttrails:read
POST/v1/trails/routesSave a planned route (the line is made from the points)trails:write
DELETE/v1/trails/routes/:idDelete a planned route (its link stops working)trails:write
GET/v1/trails/routes/:idOne of your planned routes, with its line and profiletrails:read
PATCH/v1/trails/routes/:idRename a planned route, change its points, or share it by linktrails:write
GET/v1/trails/routes/:id/gpxA planned route as a GPX filetrails:read
DELETE/v1/trails/saved/:trail_idTake a trail off a list (or off all your lists)trails:write
GET/v1/trails/saved/:trail_idWhich of your lists hold a trailtrails:read
PUT/v1/trails/saved/:trail_idSave a trail to a list (Want to go, unless you name one)trails:write
GET/v1/trails/setupYour first steps and which are donetrails:read
GET/v1/trails/teamYour team: each member, their role and what they may domembers:read
PUT/v1/trails/team/:user_idSet what a team member may do: a role, or abilities one by one. Only an owner gives or takes settings access (web app only)members:write
POST/v1/trails/team/inviteInvite someone to the team by email with a role, which they get when they accept (owners only) (web app only)members:write

Examples

GET /v1/data/activities/$TOKEN

A shared activity (its start, end and privacy zones left out). No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/activities/$TOKEN"
const res = await fetch(`https://api.tarnpath.com/v1/data/activities/${token}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/commons/$ID

A Wikimedia Commons photo near a trail (credit it as the trail's commons_photos say). No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/commons/$ID"
const res = await fetch(`https://api.tarnpath.com/v1/data/commons/${id}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/lists/$TOKEN

A list of trails someone shared by link. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/lists/$TOKEN"
const res = await fetch(`https://api.tarnpath.com/v1/data/lists/${token}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/live/$TOKEN

A live location someone shared with you. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/live/$TOKEN"
const res = await fetch(`https://api.tarnpath.com/v1/data/live/${token}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/photos/$KEY

A published trail photo. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/photos/$KEY"
const res = await fetch(`https://api.tarnpath.com/v1/data/photos/${key}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/places

Towns, ZIP codes and parks whose name starts with what was typed ("boulder", "maplewood, nj", "07040", "rocky mountain"), with where to move the map (a park's box); go is the one place a state or ZIP code made certain. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/places"
const res = await fetch(`https://api.tarnpath.com/v1/data/places`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/routes/$TOKEN

A planned route someone shared by link. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/routes/$TOKEN"
const res = await fetch(`https://api.tarnpath.com/v1/data/routes/${token}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/states

The states with trails, and how many each has. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/states"
const res = await fetch(`https://api.tarnpath.com/v1/data/states`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/states/$STATE/download

Every trail in a state as one GeoJSON file, under the Open Database License. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/states/$STATE/download"
const res = await fetch(`https://api.tarnpath.com/v1/data/states/${state}/download`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/states/$STATE/index

Every trail in a state: its address, name and when it changed (for the public site's pages and sitemaps). No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/states/$STATE/index"
const res = await fetch(`https://api.tarnpath.com/v1/data/states/${state}/index`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails

Trails in a map area, by name, or near a point, with filters for difficulty, length, climb, activity, route type and dogs. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/$ID

One trail: its line, elevation profile, length, climb, estimated difficulty and time, trailhead, what is along it, sources and nearby trails. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/$ID"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/${id}`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/$ID/commons

Free-license photos from Wikimedia Commons taken near a trail, each with its credit. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/$ID/commons"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/${id}/commons`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/$ID/gpx

A trail's line as a GPX file, for a GPS or another app. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/$ID/gpx"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/${id}/gpx`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/$ID/reviews

A trail's published reviews, photos and recent conditions, with its average rating. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/$ID/reviews"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/${id}/reviews`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/$ID/weather

The forecast and active alerts at a trail's trailhead (or its middle), from the National Weather Service. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/$ID/weather"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/${id}/weather`, {
  method: "GET",
});
const data = await res.json();

GET /v1/data/trails/ids

Only the ids of the trails in a map area that the same filters as the list keep, so the map draws only those lines. No sign-in, so it sends no key.

curl -s "https://api.tarnpath.com/v1/data/trails/ids"
const res = await fetch(`https://api.tarnpath.com/v1/data/trails/ids`, {
  method: "GET",
});
const data = await res.json();

GET /v1/trails/activities

Your recorded and imported activities, newest first

curl -s "https://api.tarnpath.com/v1/trails/activities" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/activities

Save a recorded activity (the track packed by the app); safe to retry with the same client_id

curl -s -X POST "https://api.tarnpath.com/v1/trails/activities" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/trails/activities/$ID

Delete an activity for good

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/activities/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/activities/$ID

One activity: its line, elevation and numbers

curl -s "https://api.tarnpath.com/v1/trails/activities/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

PATCH /v1/trails/activities/$ID

Rename an activity, change its kind, or share it (private, anyone with the link, or public)

curl -s -X PATCH "https://api.tarnpath.com/v1/trails/activities/$ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/activities/$ID/export

An activity as GeoJSON (for maps) or CSV (a row a point, for a spreadsheet)

curl -s "https://api.tarnpath.com/v1/trails/activities/$ID/export" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/${id}/export`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/activities/$ID/gpx

An activity as a GPX file, every point (it's yours)

curl -s "https://api.tarnpath.com/v1/trails/activities/$ID/gpx" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/${id}/gpx`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/activities/import

Import an activity from a GPX file's text or a FIT file (base64), as watches and other apps export them

curl -s -X POST "https://api.tarnpath.com/v1/trails/activities/import" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/activities/import`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/lists

Your saved lists, with how many trails each holds

curl -s "https://api.tarnpath.com/v1/trails/lists" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/lists

Make a new list

curl -s -X POST "https://api.tarnpath.com/v1/trails/lists" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/trails/lists/$ID

Delete a list (the trails stay on the map)

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/lists/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/lists/$ID

One list and its trails (yours, or one shared with your account)

curl -s "https://api.tarnpath.com/v1/trails/lists/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

PATCH /v1/trails/lists/$ID

Rename a list, share it by link, or share it with everyone in your account

curl -s -X PATCH "https://api.tarnpath.com/v1/trails/lists/$ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PUT /v1/trails/lists/order

Put your lists in this order (Want to go stays first)

curl -s -X PUT "https://api.tarnpath.com/v1/trails/lists/order" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/lists/order`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/live

Your live shares, newest first

curl -s "https://api.tarnpath.com/v1/trails/live" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/live`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/live

Start sharing where you are (a link you send yourself; optional due-back time and up to 3 email contacts)

curl -s -X POST "https://api.tarnpath.com/v1/trails/live" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/live`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PATCH /v1/trails/live/$ID

Change a running share's due-back time or contacts (the link stays the same)

curl -s -X PATCH "https://api.tarnpath.com/v1/trails/live/$ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/live/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/trails/live/$ID/end

End a live share (I'm back): the link stops showing where you are

curl -s -X POST "https://api.tarnpath.com/v1/trails/live/$ID/end" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/live/${id}/end`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PUT /v1/trails/live/$ID/position

Where you are now, for a running share (only the latest is kept)

curl -s -X PUT "https://api.tarnpath.com/v1/trails/live/$ID/position" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/live/${id}/position`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/photos/$KEY

One of your photos, published or not

curl -s "https://api.tarnpath.com/v1/trails/photos/$KEY" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/photos/${key}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/plan

A route through points, along the trails between them where it can (a preview: nothing is saved)

curl -s -X POST "https://api.tarnpath.com/v1/trails/plan" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/plan`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/plus

Which Plus features your account has (all, until paid plans open)

curl -s "https://api.tarnpath.com/v1/trails/plus" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/plus`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/privacy-zones

Your privacy zones

curl -s "https://api.tarnpath.com/v1/trails/privacy-zones" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/privacy-zones`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/privacy-zones

Add a privacy zone (a circle 200 m to 1.6 km across the middle of it)

curl -s -X POST "https://api.tarnpath.com/v1/trails/privacy-zones" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/privacy-zones`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/trails/privacy-zones/$ID

Remove a privacy zone

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/privacy-zones/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/privacy-zones/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/reports

Report a review, photo or condition to our moderators

curl -s -X POST "https://api.tarnpath.com/v1/trails/reports" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/reports`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/trails/review-photos/$ID

Delete one of your photos

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/review-photos/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/review-photos/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

DELETE /v1/trails/reviews/$TRAIL_ID

Delete your review of a trail, with its photos

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/reviews/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/reviews/${trail_id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/reviews/$TRAIL_ID

Your review of a trail, whatever its status (null when you haven't written one)

curl -s "https://api.tarnpath.com/v1/trails/reviews/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/reviews/${trail_id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

PUT /v1/trails/reviews/$TRAIL_ID

Write or change your review of a trail (stars, words, when you went, and what it was like)

curl -s -X PUT "https://api.tarnpath.com/v1/trails/reviews/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/reviews/${trail_id}`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/trails/reviews/$TRAIL_ID/photos

Add a photo to your review (JPEG, PNG or WebP, base64; its location and camera data are removed)

curl -s -X POST "https://api.tarnpath.com/v1/trails/reviews/$TRAIL_ID/photos" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/reviews/${trail_id}/photos`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/routes

Your planned routes, newest first

curl -s "https://api.tarnpath.com/v1/trails/routes" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

POST /v1/trails/routes

Save a planned route (the line is made from the points)

curl -s -X POST "https://api.tarnpath.com/v1/trails/routes" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/trails/routes/$ID

Delete a planned route (its link stops working)

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/routes/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/routes/$ID

One of your planned routes, with its line and profile

curl -s "https://api.tarnpath.com/v1/trails/routes/$ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

PATCH /v1/trails/routes/$ID

Rename a planned route, change its points, or share it by link

curl -s -X PATCH "https://api.tarnpath.com/v1/trails/routes/$ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/routes/$ID/gpx

A planned route as a GPX file

curl -s "https://api.tarnpath.com/v1/trails/routes/$ID/gpx" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/routes/${id}/gpx`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

DELETE /v1/trails/saved/$TRAIL_ID

Take a trail off a list (or off all your lists)

curl -s -X DELETE "https://api.tarnpath.com/v1/trails/saved/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/saved/${trail_id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/saved/$TRAIL_ID

Which of your lists hold a trail

curl -s "https://api.tarnpath.com/v1/trails/saved/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/saved/${trail_id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

PUT /v1/trails/saved/$TRAIL_ID

Save a trail to a list (Want to go, unless you name one)

curl -s -X PUT "https://api.tarnpath.com/v1/trails/saved/$TRAIL_ID" \
  -H "Authorization: Bearer $TR_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.tarnpath.com/v1/trails/saved/${trail_id}`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/trails/setup

Your first steps and which are done

curl -s "https://api.tarnpath.com/v1/trails/setup" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/setup`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

GET /v1/trails/team

Your team: each member, their role and what they may do

curl -s "https://api.tarnpath.com/v1/trails/team" \
  -H "Authorization: Bearer $TR_API_KEY"
const res = await fetch(`https://api.tarnpath.com/v1/trails/team`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TR_API_KEY}` },
});
const data = await res.json();

Request and response schemas: https://www.tarnpath.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.
Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.