I found a document: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-get which has rest api to create jira project , and projectTemplateKey in request body.
When I create a jira project by rest api, I want an existed jira project as template.
How can I know the existed jira project's projectTemplateKey?
Welcome to community, I think you're referring to the shared template API.
Where ProjectId is the id of the existing project.
However that API is not official if you're using Cloud, so I wouldn't rely on it so much but you can test it to see if it works for you!
It's because, most of the time users wouldn't really want to create a project based of another Project from an API perspective. Likewise if the API is not documented on Atlassian developer pages it isn't official. which means it can stop working at any time without any prior notification to you the user.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events