Add and remove routes
Edits the route list and nothing else: no module, no other spec key. Removals run first, then additions are
appended; a route in neither list stays. A route is a hostname, or hostname/path/prefix (at most 8 segments,
no trailing slash). A team may add <label>.<team slug>.sproutboat.app names, or hostnames it has verified under
/v1/domains; other names are 403 host-not-yours. A route another app holds is 409 route-taken. At most 64
routes per app. Bumps record_generation.
/v1/apps/{project}/routesAuthorizationBearer token · headerrequiredA team API key, sbk_..., from Settings, API keys.
x-api-keyAPI key · headerrequiredThe same key, in a header of its own.
projectstringrequiredThe app's name, unique within the team. 3 to 51 characters (or 1), lowercase letters, digits and dashes, not starting or ending with a dash.
application/jsonaddstring[]removestring[]The routes after the change.
app_idstringrequiredrecord_generationintegerrequiredhostsstring[]requiredThe request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredinvaliderrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerNo key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key lacks a grant (forbidden), or a route is not the team's to use (host-not-yours).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredforbiddenneedstringrequiredThe grant, as <resource>:<action>, for example app:write.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredhost-not-yourspathstringrequiredhostsNo such app, build, secret, manifest or claim in this team (another team's resource looks the same).
errorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerAnother app holds one of the routes (reason: route-taken).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredroute-takenpathstringrequiredhostsThe body is over the limit for this route (reason: too-large; some refusals carry a message only).
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredtoo-largeerrorstringrequiredA message for people. Do not parse it.
reasonstringA stable, machine-readable cause, when there is one.
pathstringThe request field at fault.
needstringThe grant a 403 asks for, app:write for example.
retry_after_sintegerThe key is over its requests a minute (600, or 2,000 with app:write; reason: key-rate-limited, retry_after_s, Retry-After). Wait that long and retry.
errorstringrequiredA message for people. Do not parse it.
reasonstringrequiredkey-rate-limitedretry_after_sintegerrequiredSeconds to wait; also the Retry-After header.