Skip to content
POST /sync-job-cron-trigger

Request Body

argsRecord<string, any>

The arguments passed to the sync job run.

Example: { "project_slug": "vcs_provider/org_name/repo_name" }
cron_expressionstring

The cron expression that defines when the sync job should be run. The timezone used is UTC. Runs must be at least 5 minutes apart. When the trigger is saved, the gap between its next two runs is checked.

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
integrated_account_idstring · uuid

The ID of the integrated account that this sync job run belongs to.

Example: 94801e49-a652-42f9-af14-dd203d7897da
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

The ID of the sync job to run.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795
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
idstring · uuid

The ID of the sync job cron trigger.

Example: 4a4de828-f4db-4c9e-adfd-434e0864c3c7
integrated_account_idstring · uuid

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

Example: 94801e49-a652-42f9-af14-dd203d7897da
resourcesobject[]

The resources to sync as part of the sync job.

depends_onstring

The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. {{resources.crm.contacts.id}} if depends on is crm/contacts resource.

Example: crm/contacts
idstring

The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.

Example: Static value like `4a4de828-f4db-4c9e-adfd-434e0864c3c7` or placeholder like `{{args.user_id}}`.
loop_onstring

When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called user_ids which is an array of strings, and you want to fetch each user's details, you can set this parameter to args.user_ids and the request will be repeated for each element in the user_ids array.

Example: args.user_ids
methodstring

The method to call on the resource.

Example: list
namestring

The name of the node. Required on runtime version 4, where depends_on and destinations refer to nodes by name. Keep names unique within a sync job.

Example: tickets
persistboolean

Whether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to true to persist them. Unified API resources are always persisted.

queryRecord<string, any>

The query parameters to pass to the resource method. It supports placeholders for values.

Example: { "page": 1, "per_page": 100, "user_id": "{{args.user_id}}" }
resourcestring

The name of the resource to sync. Required for request nodes and on runtime versions 1 to 3. For Unified APIs, it should be in the format unified_api_name/resource_name. For Proxy API, it can just be resource_name.

Example: For fetching Contacts from CRM Unified API, `crm/contacts`. For fetching Contacts from a Proxy API, `contacts`.
run_ifstring

A JSONata expression. On runtime version 4 the node runs only when it evaluates to a truthy value.

typestring

The node type. Required on runtime version 4. Each type reads its own fields; resource, method, id, query and loop_on apply to request nodes.

Example: request
Possible values:
requesttransformspooladd_contextdestinationeventget_stateupdate_statedelete_state
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 create \
  -b '{
  "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
  "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
  "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *"
}' \
  -o json
import Truto from '@truto/truto-ts-sdk';

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

const body = {
  "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
  "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
  "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *"
};

const result = await truto.syncJobCronTrigger.create(body);

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

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

async def main():
    body = {
        "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
        "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
        "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
        "daemon_group_key": "default",
        "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
        "super_query": "apac",
        "cron_expression": "0 0 * * *"
    }

    result = await truto_api.sync_job_cron_triggers.create(body)
    print(result)

asyncio.run(main())
curl -X POST 'https://api.truto.one/sync-job-cron-trigger' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
  "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
  "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *"
}'
const body = {
  "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
  "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
  "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
  "daemon_group_key": "default",
  "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
  "super_query": "apac",
  "cron_expression": "0 0 * * *"
};

const response = await fetch('https://api.truto.one/sync-job-cron-trigger', {
  method: 'POST',
  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"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "sync_job_id": "1ba1f401-7183-47c5-9e39-e8e257e3c795",
    "args": "{\n  \"project_slug\": \"vcs_provider/org_name/repo_name\"\n}\n",
    "integrated_account_id": "94801e49-a652-42f9-af14-dd203d7897da",
    "daemon_group_key": "default",
    "webhook_id": "4a4de828-f4db-4c9e-adfd-434e0864c3c7",
    "super_query": "apac",
    "cron_expression": "0 0 * * *"
}

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