Skip to main content
POST
/
v1
/
sync
/
jobs
/
{job_id}
/
cancel
Cancel Sync Job
curl --request POST \
  --url https://api.example.com/v1/sync/jobs/{job_id}/cancel
{
  "id": "<string>",
  "status": "<string>",
  "modified_at": "<string>"
}

Overview

Cancel a sync job that is currently running or pending. The job will be gracefully stopped and marked as cancelled. Cancellation Behavior:
  • Jobs in pending or in_progress status can be cancelled
  • Cancellation is graceful - the current operation completes before stopping
  • Partial data may be committed depending on when cancellation occurs
  • Status transitions: in_progresscancellingcancelled
Note: This endpoint is not yet implemented in the current codebase. The endpoint structure is defined but the cancel operation needs to be added to the sync service.

Path Parameters

job_id
string
required
Unique UUID identifier of the sync job to cancelExample: “770e8400-e29b-41d4-a716-446655440002”

Response

Returns the updated sync job object with cancelling or cancelled status.
id
string
required
UUID of the sync job
status
string
required
Updated job status: cancelling or cancelled
modified_at
string
required
Updated timestamp when cancellation was requested (ISO 8601)

Example Request

curl -X POST https://api.airweave.ai/v1/sync/jobs/770e8400-e29b-41d4-a716-446655440002/cancel \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "id": "770e8400-e29b-41d4-a716-446655440002",
  "sync_id": "660e8400-e29b-41d4-a716-446655440001",
  "status": "cancelling",
  "modified_at": "2024-03-20T10:03:15Z"
}

Error Responses

404 Not Found
Sync job with the specified ID does not exist or does not belong to your organization
400 Bad Request
Job cannot be cancelled (already completed, failed, or cancelled)
401 Unauthorized
Missing or invalid authentication
501 Not Implemented
Cancel functionality is not yet implemented