API: Unauthorized error when accessing uploaded files in submissions

  • Profile Image
    richardamphlett
    Asked on June 5, 2026 at 11:47 AM

    Hi

    I am trying out the API using the C# code prvided on GitHub. I can access forms and download submission data but as soon as I try to access files uplaoded to a submission I get a 401 error "The remote server returned an error: (401) Unauthorized". How do I go about authentication to allow files to be enumerated and downloaded via the API?

    I have tried using the "Try it out" for "GET /form/{id}/files" on "https://api.jotform.com/docs/#faq" with the same 401 error.

    Thanks or any help you can offer

    Richard


  • Profile Image
    Podo: Support Specialist
    Replied on June 5, 2026 at 11:47 AM

    Hi Richard,

    Thanks for reaching out to Jotform Support. I'm an AI assistant here to assist you.

    From what you described, the 401 Unauthorized when trying to access uploaded files is typically related to Jotform’s privacy setting that requires login to view or download uploaded files. When this is enabled, file URLs and file-list endpoints will only work for authenticated, logged-in users; otherwise, access is blocked.

    Let me walk you through how to allow access to uploaded files without requiring a login:

    1. Go to your Workspace page, then click on your Profile Picture/Avatar in the top-right corner.
    2. Click on Settings in the menu to open your Settings page in a new tab.
    3. Open the Security tab on the left, then click on Send Verification Code in the verification prompt.
    4. Copy the verification code sent to the email address associated with your Jotform account.
    5. Enter the verification code in the prompt to confirm you are changing security settings (you may or may not need to click a green Verify button after entering it).
    6. Under the Privacy section, uncheck the option Require Log-in to View Uploaded Files.

    Once this setting is disabled, anyone (including your API calls and direct file URLs) can access and download uploaded files without needing to be logged in, which should resolve the 401 responses when enumerating and downloading files via the API.

    Important notes:

    • For HIPAA-friendly accounts, this privacy option for file uploads cannot be disabled. In that case, access to uploaded files always requires a logged-in, authorized session.
    • If your account is under certain required security settings (for example, after completing specific verification processes), this option may also be locked and not changeable.

    If you prefer not to change this global privacy setting, you can still obtain uploaded files by downloading them via Jotform Tables or Inbox instead of direct file URLs. For example, in Tables you can:

    1. Open your form’s submissions in Jotform Tables.
    2. Click on Download All and choose Download Attachments to receive a ZIP file of all uploaded files via email.
    3. Or select specific rows and use the Download Attachments option to download only a subset of files.

    Let us know if you have any other questions.

  • Profile Image
    richardamphlett
    Replied on June 8, 2026 at 11:20 AM
    Hi
    I still have an issue with accessing files via the API.
    As an example:
    1) I receive an email for a form that has been filled in and that contains
    a URL to a file e.g. "
    https://www.jotform.com/widget-uploads/voiceRecorder/260304027692048/6a22f41114f26_17806756016a22f4111f248.wav".
    I can download this file by clicking on the link. I can copy the URL to
    another browser where I am not logged into Jotform and also download the
    file.
    2) I use the API to find the latest submission. In the data for the
    submission with the file attached I can see a partial URL for the file e.g.
    ""answer":
    "/widget-uploads/voiceRecorder/260304027692048/8vj6zmi08lqe_cssv2vmd1wsh4oell0zw8vd697e0533423d3.mp4""
    (formatted by my code).
    3) I can add the header "https://jotform.pro-bark.biz" to the partial URL and
    download the file
    I could not do this before I changed the permissions to disable the
    "requires login to view or download uploaded files" option.
    BUT.
    If I call the C# code "var formFiles =
    client.getFormFiles(Convert.ToInt64(root.ID));" to get a list of all the
    files in the submission I get a 401 permission error exception.
    Do you have any suggestions for how to fix this 401 error?
    Thanks, Richard
    ...
  • Profile Image
    Kevin JotForm Support
    Replied on June 8, 2026 at 11:53 AM

    Hi Richard,

    The information you provided to us confirms that the file access restriction related to the Require login to view uploaded files setting has been successfully resolved. Regarding the 401 Unauthorized error when calling getFormFiles, this endpoint has stricter authentication requirements compared to retrieving submissions or accessing file URLs directly. In this case, the error is typically related to how the API request is being authenticated.

    To help us narrow this down, could you please confirm the following:

    1. Are you initializing the API client using your API key (e.g., new JotFormClient("YOUR_API_KEY"))?
    2. Does the API key belong to the same account that owns the form?
    3. Are you passing the correct Form ID (not a submission ID) in the getFormFiles request?

    In the meantime, since you’re already able to retrieve file paths from the submission data and download them successfully by prefixing with https://www.jotform.com, we recommend continuing with this approach. It is generally the most reliable method for accessing uploaded files via the API.

    If you can share a snippet of how you're initializing the client or making the getFormFiles call (with sensitive information removed), we’d be happy to take a closer look and assist further.

    Once we hear back from you, we can help you sort this out.

Your Reply