API ReferenceValidationsCreate Validation

Create Validation

POST /api/v1/payroll-migrations/{migration_id}/validations/

Compares a source run against a target run to generate a validation report. The report contains field-level discrepancies between the source and target extraction results.

Authentication

Requires an API key with validations:write scope. Pass via the X-API-Key header.

Path Parameters

ParameterTypeDescription
migration_idstring (UUID)The ID of the payroll migration.

Request Body

FieldTypeRequiredDescription
source_run_idstring (UUID)YesThe ID of the source run to compare.
target_run_idstring (UUID)YesThe ID of the target run to compare against.
{
  "source_run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "target_run_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
}

Response

Status: 201 Created

{
  "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "migration_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
  "source_run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "target_run_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "status": "pending",
  "report": null,
  "created_at": "2026-03-16T12:00:00Z"
}

Response Fields

FieldTypeDescription
idstring (UUID)Unique identifier for the validation.
migration_idstring (UUID)The migration this validation belongs to.
source_run_idstring (UUID)The source run used for comparison.
target_run_idstring (UUID)The target run used for comparison.
statusstringValidation status: pending, processing, completed, or failed.
reportobject or nullField-level discrepancy report. null until processing completes.
created_atstring (ISO 8601)Timestamp when the validation was created.

The report field is populated asynchronously. Poll the Retrieve Validation endpoint to check for completion.

Errors

StatusDescription
400Invalid request body or run IDs do not belong to this migration.
401Missing or invalid API key.
403API key does not have validations:write scope.
404Migration not found.

Code Examples

curl -X POST https://api.parsifyhq.com/api/v1/payroll-migrations/d4e5f6a7-b8c9-0123-defa-234567890123/validations/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "target_run_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
  }'