Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

[API] Upload screenshot


I want to upload a screenshot taken by my automation when a test fails, but there doesn’t seem to be a way to do this in the add_result API (I’m using v2). Is it a different API to add a file to a test result?

Myles Stewart

[UI Script][Plugin][PoC] TestRail plugins — working demo

Hello Myles,

Thanks for your posting. The API currently doesn’t support attachments/file uploads unfortunately. We recommend uploading the screenshot to an external location and then adding a simple image link to the test result. Text boxes in TestRail support a rich-text format called Markdown and you can add images to the test result comment as follows:

I hope this helps and please let me know in case you have any further questions!



I would like like to suggest some related changes to the API. I would like to generate new test cases on demand from and new button on our defect tracker system. The API allow basic creation of the test case, but not to add any screenshot images that may be filed against the bug. Can you expose this capability through the API in the next release.


Hello Gerry,

Thanks for your posting. We currently recommend uploading files and screenshots to an external location and referencing them as part of the test case. It’s also planned to add support for attachments to the API and I’ve just added another vote to this feature request, thanks!




Any update on this issue? Is there anywhere we can track these feature requests? Adding attachments via api would be super helpful.


For the record, please add my vote for that too. Looks like that’s the only thing missing from the API before all test case management functions are covered


Hi all!

There’s currently no direct update on this but we still have this on our todo list. I’ve added your votes, thanks for your feedback! You can always use the workaround of uploading the files/screenshots/attachments to an external location and then referencing the files via links in your result description.



Hi @tgurock,

We are already using the method you described here.
But, at the same time we are waiting for an update to this request.
It would be nice to get an update about this again.
Also, please add my vote to the feature request. :wink:

Thank you.



Added to the list, Sanat, thanks for your feedback! :slight_smile:



This would be huge to my team. +1 vote


Added another vote, thanks for the feedback :smile:



+1, I’d like to see this too.


another +1 from our side here. This would make our pipeline way simpler


Added, thanks :smile:



+1 for our team as well.


Added to the list, thanks :smile:



Any update on this feature request please, I would like to up vote this too.


Hello Ankit,

Thanks for your feedback! We currently don’t have an estimate for this feature but I’m happy to add another vote. We can recommend the workaround of uploading the file to an external location and simply including a link/embed the screenshot as part of your result description.




We would really like to have this feature as well, please add another vote


Thanks for your feedback, Sander :slight_smile: