List sync job runs
/sync-job-run
You can use this endpoint to list all the sync job runs that have been created for your Truto account.
Query Parameters
Only the runs of this sync job.
Only the runs of this integrated account. Runs on runtime version 4 store 00000000-0000-0000-0000-000000000000 here, so filter those by sync_job_id.
Only the runs with this status.
createdrunningrate_limitedcompletedfailedstopped
Filter by run ID. Supports a prefix search, for example id[like]=1d4f1cb2%.
Filter by when the run was last updated. Stored as UTC YYYY-MM-DD HH:MM:SS, so compare in that format, with gt, gte, lt or lte, for example updated_at[gte]=2024-03-01 00:00:00.
Sort the runs by a field, for example sort_by[updated_at]=desc.
The number of runs per page. Default and maximum 5000.
The next_cursor from the previous page.
Response Body
The arguments passed to the sync job run.
{"project_slug":"vcs_provider/org_name/repo_name"}The date and time when the sync job run was created.
2021-08-10T10:00:00.000ZThe name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto finds 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 while creating a Sync Job Run.
defaultThe daemon_id attribute of a daemon that is running this sync job.
5b8f2a1e-3c4d-4e6f-9a7b-1c2d3e4f5a6bThe datastore a run created before run-level datastores were removed was started with. A new run always has null. Use a datastore destination on a runtime version 4 sync job instead.
An optional delay, in milliseconds, between requests made by the run on runtime version 4.
How a run on runtime versions 1 to 3 handles a failed request. fail_fast (version 1 only) stops the run at the first error. ignore carries on and sends a sync_job_run:record_error event for each error. batch (versions 2 and 3, runs with a webhook_id) carries on and sends sync_job_run:record_error events with the errors batched in errors. Versions 2 and 3 treat fail_fast as ignore. Version 4 ignores this field.
ignorefail_fastignorebatch
When set, only these sync_job_run:* and record:* events are sent for the run. When not set, every event is sent.
["sync_job_run:completed","sync_job_run:failed"]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:stalelink_token:connection_errorenvironment_integration:createdenvironment_integration:updatedenvironment_integration:deletedenvironment_unified_model:createdenvironment_unified_model:updatedenvironment_unified_model:deletedapi_token:createdapi_token:updatedapi_token:deletedsync_job_run:createdsync_job_run:updatedsync_job_run:startedsync_job_run:completedsync_job_run:failedsync_job_run:deletedsync_job_run:recordsync_job_run:record_errorsync_job_run:rate_limitedrecord:createdrecord:updatedrecord:deletedrecord:metasync_job_cron_trigger:failedbatch_job:dry_run_completedbatch_job:completedbatch_job:dry_run_failedbatch_job:failed+ 28 more
The date and time when the sync job run was finished.
2021-08-10T10:00:00.000ZWhether the run was started even though another run of the same sync job, integrated account and args was still active.
falseThe ID of the sync job run.
4a4de828-f4db-4c9e-adfd-434e0864c3c7Specifies if the sync job run was started ignoring the previous run date. Runtime versions 1 to 3 only.
falseOn runtime versions 2 to 4, how many queued requests the run takes at a time. Defaults to 1.
The ID of the integrated account that this sync job run belongs to. On runtime version 4 this is 00000000-0000-0000-0000-000000000000; the accounts the run calls are in args. Filter version 4 runs by sync_job_id.
94801e49-a652-42f9-af14-dd203d7897daAny JSON object stored with the run, as sent when the run was created or updated.
The sync job's mutex_key with the run's args filled in.
The statistics of the resources synced in the sync job run. This will have information around how many records were fetched and persisted by the sync job run -- grouped by the resource and method. The data is updated every 10 seconds while the sync job run is running.
{
"crm/contacts": {
"list": {
"fetched": 100,
"persisted": 100
}
},
"crm/deals": {
"list": {
"fetched": 100,
"persisted": 0
},
"get": {
"fetched": 100,
"persisted": 100
}
}
}The resources to sync as part of the sync job.
22 properties
request nodes: the request body. An object whose values may use placeholders, or a JSONata string that returns the object.
The settings of a non-request node. Its shape depends on type: for example expression on transform and add_context nodes, key on the state nodes, name on event nodes and id on destination nodes.
Runtime version 4, any node: true logs a transform node's input and output.
request nodes, runtime version 4: a pause in milliseconds after each call.
request nodes, for runs that store Unified API records in Super Query: what happens to the stored records of this job and account that the run did not write. hard deletes them; soft marks them truto_deleted. Not used by runs that send to a webhook.
hardsoft
With delete_tracking, a filter (placeholders allowed) that narrows which stored records are checked.
The name of the parent node (on runtime versions 1 to 3, its name or resource). The node runs only after its parent, and each object synced for the parent is available as the resources object in placeholders, e.g. {{resources.crm.contacts.id}} when the parent is the crm/contacts resource.
list-contactsdestination nodes, runtime version 4: where the records go. config.id names the webhook or datastore.
webhookdatastore
The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
Static value like `4a4de828-f4db-4c9e-adfd-434e0864c3c7` or placeholder like `{{args.user_id}}`.request nodes, runtime version 4: the integrated account to call. Required there, usually {{args.integrated_account_id}}. Versions 1 to 3 refuse it and call the run's own integrated_account_id. On version 4, add_context and get_state nodes also take it.
{{args.integrated_account_id}}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.
args.user_idsThe method to call on the resource.
listThe 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.
ticketsrequest nodes, runtime version 4: a JSONata expression. Truto fetches the next page only while it is truthy.
Runtime versions 1 to 3 only; refused on version 4. 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.
The query parameters to pass to the resource method. An object whose values may use placeholders, or a JSONata string that returns the object.
{"page":1,"per_page":100,"user_id":"{{args.user_id}}"}request nodes: call the same resource again for each returned record for which if is truthy, with config.id and config.query for the next call. Use it for nested data such as child pages.
2 properties
2 properties
A placeholder or JSONata condition, or { expression } with a JSONata expression.
object · 1 property
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.
For fetching Contacts from CRM Unified API, `crm/contacts`. For fetching Contacts from a Proxy API, `contacts`.destination nodes, runtime version 4: the names of the nodes whose records this destination sends.
A JSONata expression. On runtime version 4 the node runs only when it evaluates to a truthy value.
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.
requestrequesttransformspooladd_contextdestinationeventget_stateupdate_statedelete_state
transform nodes, runtime version 4: set true when the parent is not a request node, such as a transform that builds records from args.
How many times the run has been retried.
0The date and time when the sync job run was started.
2021-08-10T10:00:00.000ZThe sync job's state_key with the run's args filled in. Names the namespace the run's state nodes use.
The status of the sync job run. created - waiting to run, running - running, rate_limited - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, completed - completed successfully, failed - failed. The run doesn't store why: the reason is in the error of the sync_job_run:failed webhook event. On runtime versions 3 and 4, a run whose integrated accounts all need reauthorization fails before its first request with truto_error_code: integrated_account_needs_reauth. A scheduled run whose accounts are all stale is created already failed and sends only sync_job_run:failed. See Sync job runs. stopped - stopped by the user.
runningcreatedrunningrate_limitedcompletedfailedstopped
The SuperQuery region the run's records are stored in, when the run uses SuperQuery as its destination.
apacwnam
13 properties
The arguments a run takes, keyed by argument name. Each value describes one argument: type, description, format and required. Truto checks only arguments whose format is integrated_account_id, webhook_id or datastore_id (the ID must exist in the sync job's environment) or super_query (apac or wnam). For those, required: true makes a run without the argument a 400. Other arguments aren't checked; use args_validation for them. On runtime version 4 the accounts a run calls are read from the arguments with format: integrated_account_id.
{
"integrated_account_id": {
"type": "string",
"format": "integrated_account_id",
"required": true
},
"project_slug": {
"type": "string"
}
}An optional JSONata expression evaluated against the run's args when a sync job run is created. Return an object with a message field to reject the args with a 400.
The date and time when the sync job was created.
2021-08-10T10:00:00.000ZThe runtime version that sync job runs use by default.
41234
An optional delay, in milliseconds, between requests made by the sync job's runs on runtime version 4.
The ID of the environment that this sync job belongs to.
05daecaf-4365-42e8-8370-8127de5dd717The ID of the sync job.
4a4de828-f4db-4c9e-adfd-434e0864c3c7The name of the integration that this sync job interacts with.
zendeskA human-readable name for the sync job.
Zendesk ticketsAn optional key, with {{args.*}} placeholders, that stops a new run from starting while a run with the same resolved key is still active. Applies on runtime version 4.
{{args.integrated_account_id}}The resources to sync as part of the sync job.
22 properties
request nodes: the request body. An object whose values may use placeholders, or a JSONata string that returns the object.
The settings of a non-request node. Its shape depends on type: for example expression on transform and add_context nodes, key on the state nodes, name on event nodes and id on destination nodes.
Runtime version 4, any node: true logs a transform node's input and output.
request nodes, runtime version 4: a pause in milliseconds after each call.
request nodes, for runs that store Unified API records in Super Query: what happens to the stored records of this job and account that the run did not write. hard deletes them; soft marks them truto_deleted. Not used by runs that send to a webhook.
hardsoft
With delete_tracking, a filter (placeholders allowed) that narrows which stored records are checked.
The name of the parent node (on runtime versions 1 to 3, its name or resource). The node runs only after its parent, and each object synced for the parent is available as the resources object in placeholders, e.g. {{resources.crm.contacts.id}} when the parent is the crm/contacts resource.
list-contactsdestination nodes, runtime version 4: where the records go. config.id names the webhook or datastore.
webhookdatastore
The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
Static value like `4a4de828-f4db-4c9e-adfd-434e0864c3c7` or placeholder like `{{args.user_id}}`.request nodes, runtime version 4: the integrated account to call. Required there, usually {{args.integrated_account_id}}. Versions 1 to 3 refuse it and call the run's own integrated_account_id. On version 4, add_context and get_state nodes also take it.
{{args.integrated_account_id}}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.
args.user_idsThe method to call on the resource.
listThe 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.
ticketsrequest nodes, runtime version 4: a JSONata expression. Truto fetches the next page only while it is truthy.
Runtime versions 1 to 3 only; refused on version 4. 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.
The query parameters to pass to the resource method. An object whose values may use placeholders, or a JSONata string that returns the object.
{"page":1,"per_page":100,"user_id":"{{args.user_id}}"}request nodes: call the same resource again for each returned record for which if is truthy, with config.id and config.query for the next call. Use it for nested data such as child pages.
2 properties
2 properties
A placeholder or JSONata condition, or { expression } with a JSONata expression.
object · 1 property
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.
For fetching Contacts from CRM Unified API, `crm/contacts`. For fetching Contacts from a Proxy API, `contacts`.destination nodes, runtime version 4: the names of the nodes whose records this destination sends.
A JSONata expression. On runtime version 4 the node runs only when it evaluates to a truthy value.
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.
requestrequesttransformspooladd_contextdestinationeventget_stateupdate_statedelete_state
transform nodes, runtime version 4: set true when the parent is not a request node, such as a transform that builds records from args.
An optional key, with {{args.*}} placeholders, that names the namespace the sync job's get_state, update_state and delete_state nodes read and write. Required for a sync job that uses those nodes.
zendesk-tickets-{{args.integrated_account_id}}The date and time when the sync job was last updated.
2021-08-10T10:00:00.000ZThe ID of the sync job that this sync job run belongs to.
4a4de828-f4db-4c9e-adfd-434e0864c3c7The date and time when the sync job run was last updated.
2021-08-10T10:00:00.000ZThe runtime version of the sync job run. Defaults to the sync job's default_runtime_version.
41234
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 while creating a Sync Job Run.
4a4de828-f4db-4c9e-adfd-434e0864c3c7truto sync-job-runs list -o jsonimport Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
for await (const item of truto.syncJobRun.list()) {
console.log(item);
}import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
async for item in truto_api.sync_job_runs.list():
print(item)
asyncio.run(main())curl -X GET 'https://api.truto.one/sync-job-run' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json'const response = await fetch('https://api.truto.one/sync-job-run', {
method: 'GET',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/sync-job-run"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
response = requests.get(url, headers=headers, params=params)
print(response.json())