Create or replace an asset's rescan schedule
curl --request PUT \
--url https://app.trustivan.com/api/v1/assets/{id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"frequency": "daily",
"scanners": [
"<string>"
],
"timezone": "Europe/Berlin"
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/schedule"
payload = {
"enabled": True,
"frequency": "daily",
"scanners": ["<string>"],
"timezone": "Europe/Berlin"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
frequency: 'daily',
scanners: ['<string>'],
timezone: 'Europe/Berlin'
})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/schedule"
payload := strings.NewReader("{\n \"enabled\": true,\n \"frequency\": \"daily\",\n \"scanners\": [\n \"<string>\"\n ],\n \"timezone\": \"Europe/Berlin\"\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}{}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Create or replace an asset's rescan schedule
PUT because a schedule is a singleton per asset: sending the same request twice must leave one schedule, which a partial unique index enforces even under a race.
Digest-pinned assets are refused. They have no tag to re-resolve, so a
“rescan” would either re-read identical bytes forever or silently scan
:latest, a different image from the one you are watching.
The answer carries timezone and, outside UTC, local_time, the clock the
schedule keeps. Changing the zone neither skips nor adds a run: the next
run stays where it is, and its local time in the new zone is the clock from
then on. On the day clocks skip that time it runs when they land, and on
the day they repeat it, it runs once.
PUT
/
assets
/
{id}
/
schedule
Create or replace an asset's rescan schedule
curl --request PUT \
--url https://app.trustivan.com/api/v1/assets/{id}/schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"frequency": "daily",
"scanners": [
"<string>"
],
"timezone": "Europe/Berlin"
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/schedule"
payload = {
"enabled": True,
"frequency": "daily",
"scanners": ["<string>"],
"timezone": "Europe/Berlin"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
frequency: 'daily',
scanners: ['<string>'],
timezone: 'Europe/Berlin'
})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}/schedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/schedule"
payload := strings.NewReader("{\n \"enabled\": true,\n \"frequency\": \"daily\",\n \"scanners\": [\n \"<string>\"\n ],\n \"timezone\": \"Europe/Berlin\"\n}")
req, _ := http.NewRequest("PUT", 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(string(body))
}{}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Body
application/json
Response
One schedule.
The response is of type object.