Skip to content
GET /sync-job

You can use this endpoint to list all the sync jobs that have been created for your Truto account.

Query Parameters

integration_namestring

The name of the integration you want to filter the sync jobs by.

Example: hubspot
environment_idstring

The ID of the environment you want to filter the sync jobs by.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795

Response Body

limitnumber
next_cursorstring
resultobject[]
args_schemaRecord<string, any>

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.

Example:
{
  "integrated_account_id": {
    "type": "string",
    "format": "integrated_account_id",
    "required": true
  },
  "project_slug": {
    "type": "string"
  }
}
args_validationstring

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.

created_atstring · date-time

The date and time when the sync job was created.

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

The runtime version that sync job runs use by default.

Example: 4
Possible values:
1234
delay_between_requests_msinteger

An optional delay, in milliseconds, between requests made by the sync job's runs on runtime version 4.

environment_idstring · uuid

The ID of the environment that this sync job belongs to.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
idstring · uuid

The ID of the sync job.

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

The name of the integration that this sync job interacts with.

Example: zendesk
labelstring

A human-readable name for the sync job.

Example: Zendesk tickets
mutex_keystring

An 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.

Example: {{args.integrated_account_id}}
resourcesobject[]

The resources to sync as part of the sync job.

22 properties
bodyRecord<string, any> | string

request nodes: the request body. An object whose values may use placeholders, or a JSONata string that returns the object.

configRecord<string, any>

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.

debugboolean

Runtime version 4, any node: true logs a transform node's input and output.

delay_after_msnumber

request nodes, runtime version 4: a pause in milliseconds after each call.

delete_trackingstring

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.

Possible values:
hardsoft
delete_tracking_queryRecord<string, any>

With delete_tracking, a filter (placeholders allowed) that narrows which stored records are checked.

depends_onstring

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.

Example: list-contacts
destination_typestring

destination nodes, runtime version 4: where the records go. config.id names the webhook or datastore.

Possible values:
webhookdatastore
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}}`.
integrated_account_idstring

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.

Example: {{args.integrated_account_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
paginate_ifstring

request nodes, runtime version 4: a JSONata expression. Truto fetches the next page only while it is truthy.

persistboolean

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.

queryRecord<string, any> | string

The query parameters to pass to the resource method. An object whose values may use placeholders, or a JSONata string that returns the object.

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

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
configobject
2 properties
idstring
queryRecord<string, any> | string
ifstring | object

A placeholder or JSONata condition, or { expression } with a JSONata expression.

One of
object · 1 property
expressionstring
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`.
resources_to_persiststring[]

destination nodes, runtime version 4: the names of the nodes whose records this destination sends.

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
use_argsboolean

transform nodes, runtime version 4: set true when the parent is not a request node, such as a transform that builds records from args.

state_keystring

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.

Example: zendesk-tickets-{{args.integrated_account_id}}
updated_atstring · date-time

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

Example: 2021-08-10T10:00:00.000Z
truto sync-jobs list -o json
import Truto from '@truto/truto-ts-sdk';

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

for await (const item of truto.syncJob.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_jobs.list():
        print(item)

asyncio.run(main())
curl -X GET 'https://api.truto.one/sync-job' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
const response = await fetch('https://api.truto.one/sync-job', {
  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"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

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