> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# Update uptime service

PATCH https://api.modulards.com/api/public/v1/uptime-services/{site_preset_uptime}
Content-Type: application/json

Changes how ONE website is monitored by Uptime Monitor. Send only what changes (at least one field); answers **200** with the uptime service document, its attributes reading back under the same keys this body accepts.

**Body** (JSON), every field optional:
- `status` (`enabled`, `disabled`) - enables or pauses the website's monitoring; enabling runs a check right away.
- `preset` (integer) - id of another Uptime Monitor global configuration to move the website to. The website keeps its current status, unlike "Assign websites to an uptime configuration", which always switches it on.
- `keyword` (object): `status` (`enabled`, `disabled`), `type` (`some`, `every` - plan-gated), `keys` (array of string). A partial `keyword` keeps the fields not sent; `keyword.keys` replaces the whole list. An enabled keyword check needs at least one keyword.
- `path` (string, nullable) - path checked on the website, e.g. `/status`; null checks the website root.
- `redirects` (object): `status` (`enabled`, `disabled`), `max_redirects` (integer, 1 to 10), `expected_url` (string, nullable). A partial `redirects` keeps the fields not sent.

`keyword` and `redirects` merge field by field over the stored section; `keyword.keys` is the only field replaced whole rather than merged.

It does NOT change the configuration itself (interval, timeout) - use "Update uptime configuration".

Requires a full-access token (read-only tokens answer 403). An uptime service or a configuration of another organization answers 404. Sending no field answers 422.

Reference: https://api.docs.modulards.com/modular-ds-public-api/uptime-services/update-uptime-service

## Authentication

- `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.

## Request

### Path parameters

- `site_preset_uptime` (string, required)

### Body (application/json)

This endpoint expects an object.

- `redirects` (object, optional)
  - `status` (string, optional)

## Response

### 200

200 - Uptime service updated

- `data` (object, optional)
  - `attributes` (object, optional)
    - `created_at` (string, optional)
    - `keyword` (object, optional)
      - `keys` (list of any, optional)
      - `status` (string, optional)
      - `type` (any, optional, nullable)
    - `next_request` (string, optional)
    - `path` (any, optional, nullable)
    - `redirects` (object, optional)
      - `expected_url` (string, optional)
      - `max_redirects` (double, optional)
      - `status` (string, optional)
    - `site_status` (string, optional)
    - `status` (string, optional)
    - `updated_at` (string, optional)
  - `id` (string, optional)
  - `links` (object, optional)
    - `self` (string, optional)
  - `relationships` (object, optional)
    - `preset` (object, optional)
      - `data` (object, optional)
        - `id` (string, optional)
        - `type` (string, optional)
  - `type` (string, optional)
- `included` (list of object, optional)
  - `attributes` (object, optional)
    - `config` (object, optional)
      - `interval` (double, optional)
      - `method` (string, optional)
      - `status_codes` (list of string, optional)
      - `timeout` (double, optional)
    - `created_at` (string, optional)
    - `default` (boolean, optional)
    - `name` (string, optional)
    - `region` (string, optional)
    - `status` (string, optional)
    - `updated_at` (string, optional)
    - `version` (double, optional)
  - `id` (string, optional)
  - `type` (string, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)

## Errors

### 422 Unprocessable Entity Error

422 - Nothing to change

- `errors` (list of object, optional)
  - `detail` (string, optional)
  - `source` (object, optional)
    - `parameter` (string, optional)
  - `status` (string, optional)
  - `title` (string, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)

## Examples

### 200 - Uptime service updated

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-09-01T08:30:00.000000Z",
      "keyword": {
        "keys": [],
        "status": "disabled",
        "type": null
      },
      "next_request": "2026-09-17T10:08:00.000000Z",
      "path": null,
      "redirects": {
        "expected_url": "https://example.com/end",
        "max_redirects": 3,
        "status": "disabled"
      },
      "site_status": "up",
      "status": "enabled",
      "updated_at": "2026-09-17T10:03:10.000000Z"
    },
    "id": "553",
    "links": {
      "self": "https://api.modulards.com/api/public/v1/uptime-services/553"
    },
    "relationships": {
      "preset": {
        "data": {
          "id": "9",
          "type": "preset-uptimes"
        }
      }
    },
    "type": "site-preset-uptimes"
  },
  "included": [
    {
      "attributes": {
        "config": {
          "interval": 300,
          "method": "HEAD",
          "status_codes": [
            "2xx"
          ],
          "timeout": 30000
        },
        "created_at": "2026-09-17T09:12:44.000000Z",
        "default": false,
        "name": "Shops",
        "region": "eu-west-1",
        "status": "enabled",
        "updated_at": "2026-09-17T09:12:44.000000Z",
        "version": 1
      },
      "id": "9",
      "type": "preset-uptimes"
    }
  ],
  "jsonapi": {
    "version": "1.1"
  }
}
```

**SDK Code**

```python 200 - Uptime service updated
import requests

url = "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime"

headers = {"Authorization": "Bearer <token>"}

response = requests.patch(url, headers=headers)

print(response.json())
```

```javascript 200 - Uptime service updated
const url = 'https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime';
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 200 - Uptime service updated
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime"

	req, _ := http.NewRequest("PATCH", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 200 - Uptime service updated
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 200 - Uptime service updated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 - Uptime service updated
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 200 - Uptime service updated
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 200 - Uptime service updated
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update uptime service

**Request**

```json
{
  "redirects": {
    "status": "disabled"
  }
}
```

**Response**

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-09-01T08:30:00.000000Z",
      "keyword": {
        "keys": [],
        "status": "disabled",
        "type": null
      },
      "next_request": "2026-09-17T10:08:00.000000Z",
      "path": null,
      "redirects": {
        "expected_url": "https://example.com/end",
        "max_redirects": 3,
        "status": "disabled"
      },
      "site_status": "up",
      "status": "enabled",
      "updated_at": "2026-09-17T10:03:10.000000Z"
    },
    "id": "553",
    "links": {
      "self": "https://api.modulards.com/api/public/v1/uptime-services/553"
    },
    "relationships": {
      "preset": {
        "data": {
          "id": "9",
          "type": "preset-uptimes"
        }
      }
    },
    "type": "site-preset-uptimes"
  },
  "included": [
    {
      "attributes": {
        "config": {
          "interval": 300,
          "method": "HEAD",
          "status_codes": [
            "2xx"
          ],
          "timeout": 30000
        },
        "created_at": "2026-09-17T09:12:44.000000Z",
        "default": false,
        "name": "Shops",
        "region": "eu-west-1",
        "status": "enabled",
        "updated_at": "2026-09-17T09:12:44.000000Z",
        "version": 1
      },
      "id": "9",
      "type": "preset-uptimes"
    }
  ],
  "jsonapi": {
    "version": "1.1"
  }
}
```

**SDK Code**

```python Update uptime service
import requests

url = "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime"

payload = { "redirects": { "status": "disabled" } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update uptime service
const url = 'https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"redirects":{"status":"disabled"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update uptime service
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime"

	payload := strings.NewReader("{\n  \"redirects\": {\n    \"status\": \"disabled\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update uptime service
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"redirects\": {\n    \"status\": \"disabled\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Update uptime service
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"redirects\": {\n    \"status\": \"disabled\"\n  }\n}")
  .asString();
```

```php Update uptime service
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime', [
  'body' => '{
  "redirects": {
    "status": "disabled"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update uptime service
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"redirects\": {\n    \"status\": \"disabled\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update uptime service
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["redirects": ["status": "disabled"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/uptime-services/site_preset_uptime")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```