HTTP 403 Access denied when submitting data through KoboToolbox OpenRosa API

We are implementing an automated data synchronization system for the Maize Observation Network (ROM) in Madagascar.

Our objective is to establish a three-level data management workflow:

  1. Data collection: Regional enumerators collect and submit survey data through KoboCollect.
  2. Regional validation: Regional validators review submissions and approve or reject them.
  3. National consolidation: Only approved submissions should be automatically transferred to a separate national KoboToolbox project.

We have separate source and national KoboToolbox projects for two surveys: Maize Prices and Agricultural Practices and Yield.

We developed a Google Apps Script using the KoboToolbox API v2 and OpenRosa to identify approved submissions and transfer them to the national project.

The script successfully retrieves the data, identifies approved submissions, and prepares the XML using the correct deployed XForm ID.

However, when submitting the approved record to the private national project, the server returns HTTP 403 – Access denied.

We have tested both kf.kobotoolbox.org and kc.kobotoolbox.org. The national projects are deployed and active, the API token works for reading data, and the multipart/form-data request is correctly generated.

We need assistance identifying the cause of HTTP 403 and determining the supported authentication method for submitting records programmatically to a private KoboToolbox project.

Our requirement is to keep the projects private

What’s happening instead?

The source KoboToolbox project contains two maize price survey submissions, including one that has been approved by the regional validator.

Our Google Apps Script successfully:

  • Connects to both source and national KoboToolbox projects using API tokens.

  • Identifies the approved submission.

  • Retrieves the source data and constructs the XML using the destination project’s deployed XForm.

  • Confirms the correct destination Form ID: aUXBrDoVQCcEAaTi4DuMPx.

  • Generates a multipart/form-data POST request containing xml_submission_file.

However, when attempting to transfer the approved submission, the server returns:

HTTP 403 – Access denied

We tested both kf.kobotoolbox.org/submission and kc.kobotoolbox.org/submission, with the same result.

The national project remains empty, even though it is deployed, active, and accessible through API v2.

The expected result is that the national project receives the approved submission, while the unapproved submission remains exclusively in the source project.

@Hioby Welcome to our community.
Can you please check the API tokens are correct and the user submitting data has the necessary permissions?
Or maybe this post from @osmanburcu can help you to fix your request

Finally, if you could share a snippet of the code or payload you’re using to build the POST request, that would be very helpful for troubleshooting and allowing us to better understand what might be going wrong.

Hi @Hioby

I think you are using the wrong url thats why it returns 403. Can you test it with this url? If you are using different server update the the link

https://kf.kobotoolbox.org/{username}/submission?format=json