Validate Parse Script
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-ID
Authorization
Bearer token - your Captain API key.
Request
This endpoint expects a multipart form containing a file.
file
The .js parsing script file to validate. Max 1 MB.
Response
Validation result. Returned for both valid AND invalid scripts.
valid
True if the script passes all validation checks.
error
Human-readable error message. Null when valid=true.
error_type
Error category. Null when valid=true.
Allowed values: