Validate Parse Script

Beta
Validates a JavaScript parsing script without running it against real data. Upload your .js file as multipart/form-data under the file field. Checks that the script parses cleanly and exports a default function. Use this before uploading a script to catch syntax errors and structural problems. The return-type contract (must return a string) is enforced at indexing time by json_handler against your real JSON.

Authentication

AuthorizationBearer
Bearer token authentication using API key

Headers

X-Organization-IDstringOptional
AuthorizationstringRequired

Bearer token - your Captain API key.

Request

This endpoint expects a multipart form containing a file.
filefileRequired
The .js parsing script file to validate. Max 1 MB.

Response

Validation result. Returned for both valid AND invalid scripts.
validboolean
True if the script passes all validation checks.
errorstring or null

Human-readable error message. Null when valid=true.

error_typeenum or null

Error category. Null when valid=true.

Allowed values: