API Upload File



  • Chris Green

    Dinesh Korgaokar - can you provide an example of how this looks in your API call?

  • enzo fass

    Also when I post to the uploads API. I am only providing the file name, is this sufficient?
    I have the feeling that it is uploading only the file name and not any contents.

  • Sebastiaan Wijchers

    Hello Enzo,

    How big is the file you're downloading in Zendesk? Is it 1.9MB like the original, or way smaller?

    You should POST the file, there is a curl example in the documentation:

    What's the response body of the call to '/api/v2/uploads.json'?

    With kind regards,

    Sparkly ⭐

  • Nida Patanarat

    Hello Enzo,

    Could you please share me the solutions on how to fix this?

    Thank you very much



    Hi All,


    When I am trying to upload a file using endpoint (POST /api/v2/uploads.json), 

    I just noticed that the file is getting uploaded, but the contents of the file(csv) is getting replaced by the Body of the API call. I am simple giving {} in the body, since without a body the API is giving error. 

    Can someone help me with a body for the endpoint? Or maybe how can I upload it with the contents.




  • Bryan Flynn

    Hi @...,

    Please give the API call that you are making at any returned HTTP status codes (removing any confidential information of course).

    Are you using the example cURL code in the reference documentation for POST /api/v2/uploads.json?

    Also check out another community post where the tool Postman was used for a file upload: Unable to upload image file via /api/v2/uploads.json through postman

    Keep in mind that uploading and attaching to a ticket is a two step process described here: Attaching files to tickets via API.

  • Paul Cunningham

    Hi this link https://develop.zendesk.com/hc/en-us/community/posts/360050023554/comments/360012872554 is no longer valid and i'm facing the same issue.

    I'm using the following requests API which allows end-users to submit requests to out support agents.


    When uploading the image the following request is made 


    This response is successful and returns a token which is then passed into the body before submitting the request 


    However, I'm experiencing the same issue as Enzo. When the ticket is received in the helpdesk it looks like the below.

    Any suggestions/help would be appreciated.

  • Eric Nelson
    Zendesk Developer Advocacy

    Hey Paul Cunningham,

    Looks like that post was archived when we moved over to our new community earlier this year. In regards to your issue, what is the Content-Type that you're setting on the post to the upload endpoint? 



  • Dinesh Korgaokar
    Zendesk Luminary


    Facing same issue with request function in APP framework. 

  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Dinesh! I responded to your comment here, but feel free to respond either in this post or the other one!

  • Chris Green

    I am facing this same issue and have not gotten any good support from Zendesk on the issue.....this is quite frustrating. I can make a call to 'List Comments' and see my attachment and can confirm that everything looks good, but when I try to view the attachment in my ticket I'm getting the same as above:


  • Dinesh Korgaokar
    Zendesk Luminary

    hello Chris Green,

    faced similar issue.  the solution worked for me is adding image blob to the <img src="image blob">. this seems auto uploads the attachments for me.  

  • Dinesh Korgaokar
    Zendesk Luminary

    Hello Chris,

    i didn't upload the file separately using api. added the blob of image in the html body and uploaded.  it auto uploaded the attachments.

  • Chris Green

    Well do you have an example of that?

  • Chris Green

    Any updates from anyone who was having this issue? 

  • Benessa Dumol

    Hello, sorry for hijacking this thread, but I am currently stuck and I desperately need some help.

    I am currently developing an app that has 2 fields, a file upload field that allows multiple files and a text area.

    Here is the current status of the app:

    • I was able to create a private comment using the value inputted on the text area
    • I was able to get the token when I uploaded the files using the Upload API

    The next goal is for all the files to be attached to the ticket. I am using this as my reference and on the examples, only 1 file is attached to the ticket comment.

    Can you help to confirm if it is possible to attach multiple files/images to 1 ticket comment? If yes, can you point me in the right direction?

    Thank you,

  • Dinesh Korgaokar
    Zendesk Luminary

    Benessa Dumol 

    are you using below JSON to send data,

     -d '{"ticket": {"comment": {"body": "Press play", "uploads": ["4bLLKSOU63CPqaIeOMXYyXzUh"]}}}'

    if yes then u need to send array of upload tokens you received after uploading. 

    "uploads": ["token1", "token2", "token3"]

    Hope this helps,


  • Bryan Flynn

    Hi @.... Looks like this question was also cross-posted in the developer community. I posted an answer there — please see https://develop.zendesk.com/hc/en-us/community/posts/360050023554/comments/360012872554. If you have follow-up questions, I can answer them there. Thanks!


Please sign in to leave a comment.

Powered by Zendesk