Is there an API which helps me to add an existing query to a redash instance?

Yes. This isn’t formally documented (yet) but you can POST to /api/queries and include a data_source_id and query in your request body.