For a file parameter, use --form instead of --data: curl JENKINS_URL/job/JOB_NAME/buildWithParameters --user USER:TOKEN --form FILE_LOCATION_AS_SET_IN_JENKINS=@PATH_TO_FILE
Authenticate with an API token rather than a session, so no CSRF crumb needs to be fetched or attached to this POST.
For a job inside a folder, the path needs a /job/ segment per folder level: JENKINS_URL/job/FOLDER/job/JOB_NAME/buildWithParameters.
The official Remote Access API page distinguishes plain /build (no parameters) from /buildWithParameters - calling the wrong one, or omitting a required parameter, can be rejected.
Resolving the queued request to a concrete build number (Location header pointing at /queue/item/<id>/, then GET queue/item/<id>/api/json and read executable.number) is described only in third-party sources, not on current jenkins.io doc pages - verify that flow against your own instance before an automation relies on it; note queue items expire a few minutes after the build starts.
buildWithParameters accepts form data (--data/--form with curl); sending parameters as JSON is not the pattern shown in the official examples.
Passing a real account password instead of a token in --user still authenticates if password auth is enabled, but the docs discourage this for scripted access.
Give your agent this knowledge — and 18,200+ more routes
One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?