const url = 'https://app.monitorly.cloud/api/v1/nodes/NODE_ID/location';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"city":"example","countryCode":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.monitorly.cloud/api/v1/nodes/NODE_ID/location \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "city": "example", "countryCode": "example" }'Sets the node’s country and city by hand; the location is then no longer detected from its address. Workspace owner or admin.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The node’s id.
Example
NODE_IDRequest Bodyrequired
Section titled “Request Bodyrequired”object
ISO 3166-1 alpha-2, upper case.
Example generated
{ "city": "example", "countryCode": "example"}Responses
Section titled “Responses”The node.
object
ISO 3166-1 alpha-2; null until the node is located (no session yet, a private or unknown address, or no IP location database).
Absent until the node’s first heartbeat.
object
online, degraded or offline, from the node’s heartbeats.
Example
{ "id": "ID", "locationSource": "auto", "scope": "platform"}Bad Request.
request.malformed: the body or a parameter is not of the expected shapeauth.credentials_conflict: the request carries both a session cookie and a token
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unauthorized.
auth.unauthenticated,auth.session_expired: no session, or it endedtoken.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Forbidden.
auth.forbidden: your role is too low for thistoken.scope_missing: the token lacks the scope this needs;detailnames itrequest.origin_mismatch,request.header_required: a changing request with a session comes from another site or lacksX-Monitorly-Request: 1
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Not Found.
request.not_found: it does not exist, or you cannot see it
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Payload Too Large.
request.too_large: the body is larger than 256 KiB
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unprocessable Entity.
field.required,field.too_long,field.invalid: a field breaks a rule;errorspoints at itnode.invalid_country: the country code is not an ISO 3166-1 alpha-2 code
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Too Many Requests.
token.rate_limited: more than 10 requests a second with this tokensession.rate_limited: more than 5 changes a second from your sessions
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Headers
Section titled “Headers”Seconds to wait before trying again.