Update field
Update an existing field's path, name template, rule type, or rule config. All fields are optional; only provided keys are updated.
PUT
/data-sources/{id}/fields/{fid}
Update an existing field's path, name template, rule type, or rule config. All fields are optional; only provided keys are updated.
Authentication
Bearer Token (hu_api_key)
Path Parameters
id
string
required
path
fid
string
required
path
Request Body required
application/jsonid
string
path
string
REQUIRED
name_template
string
REQUIRED
rule_type
string
REQUIRED
Enum:
equals, in, diff_lte, truthy, http_okrule_config
object
REQUIRED
degraded_rule_config
unknown
display_order
number
Responses
200
Field updated
No response body
400
Validation error
curl -X PUT 'https://happyuptime.com/api/v1/data-sources/string/fields/string' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "id": "string", "path": "string", "name_template": "string", "rule_type": "equals", "rule_config": {}, "degraded_rule_config": {}, "display_order": 0}'
const response = await fetch('https://happyuptime.com/api/v1/data-sources/string/fields/string', { method: 'PUT', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({ "id": "string", "path": "string", "name_template": "string", "rule_type": "equals", "rule_config": {}, "degraded_rule_config": {}, "display_order": 0 })});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.put('https://happyuptime.com/api/v1/data-sources/string/fields/string', headers=headers, json={ "id": "string", "path": "string", "name_template": "string", "rule_type": "equals", "rule_config": {}, "degraded_rule_config": {}, "display_order": 0})print(response.json())
400
Response
{ "error": { "code": "not_found", "message": "Monitor not found", "status": 404 }}
API Playground
Try this endpoint
PUT
/data-sources/{id}/fields/{fid}