Skip to content
PATCH /sync-job-run-state/{id}

Path Parameters

idstring
required·

The ID of the state to update.

Example: last_processed_id

Query Parameters

state_keystring
required·

The state_key attribute found in a sync job run and defined in the sync job. Used as a namespace for the states.

Example: sync_job_123

Request Body

valuestring

The new state value to store.

Example: eyJpZCI6IjY3ODkwIiwidGltZXN0YW1wIjoiMjAyMy0wMi0wMVQwMDowMDowMFoifQ==

Response Body

created_atstring · date-time

Timestamp when the state was created.

Example: 2023-01-01T10:00:00.000Z
keystring

The key identifier for this state.

Example: last_processed_id
sync_job_run_idstring · uuid

The ID of the sync job run this state is associated with (optional).

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

Timestamp when the state was last updated.

Example: 2023-02-01T10:00:00.000Z
valuestring

The updated state value stored.

Example: eyJpZCI6IjY3ODkwIiwidGltZXN0YW1wIjoiMjAyMy0wMi0wMVQwMDowMDowMFoifQ==
curl -X PATCH 'https://api.truto.one/sync-job-run-state/{id}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "value": "eyJpZCI6IjY3ODkwIiwidGltZXN0YW1wIjoiMjAyMy0wMi0wMVQwMDowMDowMFoifQ=="
}'
const body = {
  "value": "eyJpZCI6IjY3ODkwIiwidGltZXN0YW1wIjoiMjAyMy0wMi0wMVQwMDowMDowMFoifQ=="
};

const response = await fetch('https://api.truto.one/sync-job-run-state/{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-run-state/{id}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "value": "eyJpZCI6IjY3ODkwIiwidGltZXN0YW1wIjoiMjAyMy0wMi0wMVQwMDowMDowMFoifQ=="
}

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