Projects
Update trigger
Changes a schedule or settings, or turns a trigger on or off.
PATCH
/
api
/
projects
/
{id}
/
triggers
/
{triggerId}
Update trigger
curl --request PATCH \
--url https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId} \
--header 'Content-Type: application/json' \
--data '
{
"cron": "0 2 * * 1",
"config": {
"windowMinutes": 10,
"maxAssets": 200,
"targetTypes": []
},
"enabled": true
}
'import requests
url = "https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}"
payload = {
"cron": "0 2 * * 1",
"config": {
"windowMinutes": 10,
"maxAssets": 200,
"targetTypes": []
},
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cron: '0 2 * * 1',
config: {windowMinutes: 10, maxAssets: 200, targetTypes: []},
enabled: true
})
};
fetch('https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}', 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://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}"
payload := strings.NewReader("{\n \"cron\": \"0 2 * * 1\",\n \"config\": {\n \"windowMinutes\": 10,\n \"maxAssets\": 200,\n \"targetTypes\": []\n },\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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))
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"projectWorkflowId": "<string>",
"type": "cron",
"config": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
},
"enabled": true,
"cron": "<string>",
"lastFiredAt": "2023-11-07T05:31:56Z"
}Response
200 - application/json
⌘I
Update trigger
curl --request PATCH \
--url https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId} \
--header 'Content-Type: application/json' \
--data '
{
"cron": "0 2 * * 1",
"config": {
"windowMinutes": 10,
"maxAssets": 200,
"targetTypes": []
},
"enabled": true
}
'import requests
url = "https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}"
payload = {
"cron": "0 2 * * 1",
"config": {
"windowMinutes": 10,
"maxAssets": 200,
"targetTypes": []
},
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cron: '0 2 * * 1',
config: {windowMinutes: 10, maxAssets: 200, targetTypes: []},
enabled: true
})
};
fetch('https://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}', 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://{baseUrl}/api/v1/api/projects/{id}/triggers/{triggerId}"
payload := strings.NewReader("{\n \"cron\": \"0 2 * * 1\",\n \"config\": {\n \"windowMinutes\": 10,\n \"maxAssets\": 200,\n \"targetTypes\": []\n },\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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))
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"projectWorkflowId": "<string>",
"type": "cron",
"config": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
},
"enabled": true,
"cron": "<string>",
"lastFiredAt": "2023-11-07T05:31:56Z"
}