Protobox

URL Sync

Auto-refresh content from URLs

Configure automatic syncing for URL-sourced knowledge entries. The system periodically fetches and updates content from the source URL.

Get Sync Config

curl -X GET "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync-config" \
  -H "Authorization: Bearer <access_token>"
Response
{
  "success": true,
  "data": {
    "enabled": true,
    "intervalHours": 24,
    "lastSyncAt": "2024-01-15T08:00:00Z",
    "nextSyncAt": "2024-01-16T08:00:00Z",
    "status": "idle",
    "sourceUrl": "https://help.example.com/returns"
  }
}

Update Sync Config

Request
curl -X PATCH "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync-config" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "intervalHours": 24
  }'
curl -X PATCH "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync-config" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "intervalHours": 168
  }'
curl -X PATCH "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync-config" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'
const response = await fetch(
  'https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync-config',
  {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer ' + accessToken,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      enabled: true,
      intervalHours: 24  // daily
    })
  }
);

const { data } = await response.json();
console.log('Next sync:', data.nextSyncAt);
Response
{
  "success": true,
  "data": {
    "enabled": true,
    "intervalHours": 24,
    "lastSyncAt": "2024-01-15T08:00:00Z",
    "nextSyncAt": "2024-01-16T08:00:00Z",
    "status": "idle"
  }
}

Sync Config Parameters

enabledbooleanrequired

Enable or disable automatic syncing.

intervalHoursnumber

Sync interval in hours. Range: 1-720 (30 days).

Common values:

  • 24 - Daily
  • 48 - Every 2 days
  • 168 - Weekly
  • 720 - Monthly

Trigger Manual Sync

Force an immediate sync of a URL-sourced entry:

Request
curl -X POST "https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync" \
  -H "Authorization: Bearer <access_token>"
const response = await fetch(
  'https://platform.protobox.ai/api/v1/knowledge/695c71705a8b2ca8d9016050/sync',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + accessToken,
    }
  }
);

const { data } = await response.json();
console.log('Sync task:', data.taskId);
Response
{
  "success": true,
  "data": {
    "taskId": "task_xyz789",
    "status": "pending",
    "message": "Sync queued"
  }
}
{
  "success": true,
  "data": {
    "status": "unchanged",
    "message": "Content has not changed since last sync"
  }
}

Sync Status Values

StatusDescription
idleNot currently syncing
syncingSync in progress
failedLast sync failed

Change Detection

The sync process uses SHA-256 content hashing to detect changes:

  1. Fetch URL content
  2. Calculate SHA-256 hash
  3. Compare with stored hash
  4. If different: delete old chunks, process new content, regenerate embeddings
  5. If same: skip processing, update lastSyncAt

Manual sync via POST /sync always processes content, even if unchanged. Use this to force re-embedding after model updates.

On this page