Skip to content
PATCH /sync-job-cron-trigger/{id}

Path Parameters

idstring
required·

The ID of the sync job cron trigger to update.

Example: 1f276317-1c44-4ae8-b2e2-f7b8bc0f6aa5

Request Body

argsRecord<string, any>

Replaces the stored args.

cron_expressionstring

The cron expression that defines when the sync job should be run. The timezone used is UTC. A new value must have runs at least 5 minutes apart; the gap between its next two runs is checked. Sending the value the trigger already has is not checked again.

Example: 0 0 * * *
daemon_group_keystring

The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Example: default
error_handlingstring

The error_handling each run starts with. See the sync job run's error_handling.

Possible values:
fail_fastignorebatch
events_to_sendstring[]

When set, only these sync_job_run:* and record:* events are sent for the runs the trigger starts.

Possible values:
allintegrated_account:createdintegrated_account:updatedintegrated_account:deletedintegrated_account:activeintegrated_account:post_connect_form_submittedintegrated_account:post_install_errorintegrated_account:validation_errorintegrated_account:authentication_errorintegrated_account:forbidden_errorintegrated_account:reactivatedintegrated_account:stale+ 28 more
individual_request_batch_sizenumber

Copied to each run the trigger starts. See the sync job run's individual_request_batch_size.

is_activeboolean

Send false to stop the trigger and true to start it again. Making it inactive removes its schedule, so it creates no sync job run and sends no webhook until it is active again. A scheduled run already on its way when it was made inactive is skipped, with skip_reason trigger_inactive on its log row. Making it active schedules it again, and it next runs at its next scheduled time. Leave it out to keep the current value.

Example: false
metaRecord<string, any>

Any JSON object, copied to each run the trigger starts.

super_querystring

Store the records of the runs the trigger starts in SuperQuery in this region. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Possible values:
apacwnam
webhook_idstring · uuid

The ID of the webhook where the sync job records need to be sent. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7

Response Body

argsRecord<string, any>

The arguments passed to the sync job cron trigger.

Example: { "project_slug": "vcs_provider/org_name/repo_name" }
created_atstring · date-time

The date and time when the sync job run was created.

Example: 2021-08-10T10:00:00.000Z
cron_expressionstring

The cron expression defining when the sync job should run, in UTC.

Example: 0 0 * * *
daemon_group_keystring

The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Example: default
environment_idstring · uuid

The environment the trigger belongs to.

error_handlingstring

The error_handling each run starts with. See the sync job run's error_handling.

Possible values:
fail_fastignorebatch
events_to_sendstring[]

When set, only these sync_job_run:* and record:* events are sent for the runs the trigger starts.

Possible values:
allintegrated_account:createdintegrated_account:updatedintegrated_account:deletedintegrated_account:activeintegrated_account:post_connect_form_submittedintegrated_account:post_install_errorintegrated_account:validation_errorintegrated_account:authentication_errorintegrated_account:forbidden_errorintegrated_account:reactivatedintegrated_account:stale+ 28 more
idstring · uuid

The ID of the sync job cron trigger.

Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7
individual_request_batch_sizenumber

Copied to each run the trigger starts. See the sync job run's individual_request_batch_size.

integrated_account_idstring · uuid

The ID of the integrated account that this sync job cron trigger should run.

Example: 94801e49-a652-42f9-af14-dd203d7897da
is_activeboolean

Whether the trigger is active. An inactive trigger is not scheduled, so it creates no sync job run and sends no webhook until it is made active again. New triggers are active unless created with is_active set to false.

Example: true
metaRecord<string, any>

Any JSON object, copied to each run the trigger starts.

super_querystring

Store the records of the runs the trigger starts in SuperQuery in this region. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Possible values:
apacwnam
sync_job_idstring · uuid

The ID of the sync job that this sync job cron trigger should run.

Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7
updated_atstring · date-time

The date and time when the sync job run was last updated.

Example: 2021-08-10T10:00:00.000Z
webhook_idstring · uuid

The ID of the webhook where the sync job records need to be sent. On runtime versions 1 to 3, specify exactly one of daemon_group_key (Daemon), webhook_id (RapidBridge) or super_query.

Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7
truto sync-job-triggers update '<id>' \
  -b '{
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *",
  "args": {},
  "error_handling": "fail_fast",
  "events_to_send": [],
  "meta": {},
  "individual_request_batch_size": 0,
  "is_active": false
}' \
  -o json
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const body = {
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *",
  "args": {},
  "error_handling": "fail_fast",
  "events_to_send": [],
  "meta": {},
  "individual_request_batch_size": 0,
  "is_active": false
};

const result = await truto.syncJobCronTrigger.update('<id>', body);

console.log(result);
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    body = {
        "daemon_group_key": "default",
        "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
        "super_query": "apac",
        "cron_expression": "0 0 * * *",
        "args": {},
        "error_handling": "fail_fast",
        "events_to_send": [],
        "meta": {},
        "individual_request_batch_size": 0,
        "is_active": False
    }

    result = await truto_api.sync_job_cron_triggers.update("<id>", body)
    print(result)

asyncio.run(main())
curl -X PATCH 'https://api.truto.one/sync-job-cron-trigger/{id}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *",
  "args": {},
  "error_handling": "fail_fast",
  "events_to_send": [],
  "meta": {},
  "individual_request_batch_size": 0,
  "is_active": false
}'
const body = {
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *",
  "args": {},
  "error_handling": "fail_fast",
  "events_to_send": [],
  "meta": {},
  "individual_request_batch_size": 0,
  "is_active": false
};

const response = await fetch('https://api.truto.one/sync-job-cron-trigger/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/sync-job-cron-trigger/{id}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "daemon_group_key": "default",
    "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
    "super_query": "apac",
    "cron_expression": "0 0 * * *",
    "args": {},
    "error_handling": "fail_fast",
    "events_to_send": [],
    "meta": {},
    "individual_request_batch_size": 0,
    "is_active": False
}

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