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

Adding new test cases from API?


I’ve just starting looking at your TestRail product

We have a lot of unit and integration tests created by our development team. The range of test methods increases over time.

Does your API allow new test cases to added via the API? What I’m trying to avoid is the problem of having somebody having to manually enter test case definitions into TestRail when they already exist in the unit test classes.


Hello Ian,

There are two options to get your existing test cases imported into TestRail. The first option is to use TestRail’s XML import file format. The XML files can be used to create entire suites/sections. The exact file format is documented in TestRail’s online help and we also have conversion tools for a few formats (such as CSV/Excel).

But we also have an API that can be used to create test cases and sections remotely via HTTP calls. Please note that the Mini API available on our website doesn’t currently have this capability, but I would be happy to email you the extended API version if you are interested in this.



How do I import test cases from Excel?



Hello Mike,

Thanks for your message. You can use TestRail’s XML import file format to migrate existing test cases to TestRail. We have a script that can help you migrate Excel/CSV files to our XML file format:

We can also usually help with the migration if necessary as the conversion script usually needs some customizations in order to convert your particular Excel layout. But this is also documented on the above mentioned website.



Can you please send me the extended API for adding testcases ? We are planning add testcases through API calls as we create them in our script


I believe the ‘extended’ API is now the current API (v2: )


How far I can remember they don’t allow via any direct method.

With Regards,
Xovo larjem


But as BGanger said that way it can be done smoothly without much/any issues.

With Regards,
Protar Smith