Troubleshooting 403 errors when Batch Changes fails to push
Problem
Batch Changes reports 403 / "You are not allowed to upload code" errors when attempting to push commits to a code host.
Cause
The credential configured for Batch Changes does not have write/push permissions on the target repository.
OAuth apps may be configured without the required API scope (GitLab requires the
apiscope).
Solution
Use a credential with push access
Use a user account or service account that has write (push) permissions on the target repositories.
Preferred: create and use a Personal Access Token (PAT) with the required scopes.
If using GitLab OAuth app, enable api scope
Ensure the OAuth app configuration includes
apiscope (for example:"apiScope": "api").
Validate the credential in Site Settings → Batch Changes → Settings
Open Batch Changes settings, locate the code host credential and click the “Check” button to validate it.
Retry the failing changeset
After fixing or replacing the credential, use the Retry option on the failed changeset so the push is attempted again.
Checklist
Was a PAT used? If yes, confirm it has appropriate scopes.
Does the account associated with the credential have write access to the repo?
Does the Batch Changes credential check show as valid?
If using OAuth, does it include the required API scope (GitLab:
api)?
Further help
If you still see 403 errors after these steps, double-check repository-level permissions and consult your code host admin to verify there are no additional restrictions (IP allowlists, required approvals, or branch protections) preventing pushes.