cURL
curl --request PUT \ --url https://upcron.io/api/monitors/{id} \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "name": "My Monitor", "url": "https://example.com/health", "valid_http_codes": [ 200, 201 ], "basic_auth_username": "user", "basic_auth_password": "pass", "_method": "GET", "active": true } '
{ "message": "Monitor updated successfully", "data": { "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "name": "My Monitor", "url": "https://example.com", "project_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "valid_http_codes": [ 200, 201 ], "status": 1, "basic_auth_username": null, "method": "GET", "active": true, "created_at": "2024-01-01T12:00:00.000000Z", "updated_at": "2024-01-01T12:00:00.000000Z", "uptime": 99.5, "last_checked": "2 minutes ago", "incidents_count": 3, "last_incident_duration": 120, "project": { "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "name": "My Project", "description": "Project description" } } }
Update an existing monitor
Laravel Sanctum Bearer token authentication
Monitor ID
255
"My Monitor"
2048
"https://example.com/health"
100 <= x <= 599
[200, 201]
"user"
"pass"
GET
POST
PUT
PATCH
DELETE
HEAD
"GET"
true
Monitor updated successfully
"Monitor updated successfully"
Show child attributes