I have created a custom entity inside my shopware 6.4 instance I'm able to add, remove and delete entries but now I need to add same functionality but via shopware API
while following documentation I have found that via API i can only get data and not add new data (source showing that in services.repository
there are only fetching methods).
Is there any other way to POST data via API to shopware?
Are you developing an app? The documentation you linked to regards app scripts, which are meant to extend business logic. They're not meant to be used for persisting data. If you want to persist data you can do that requesting the shop's admin API from your own app server, where you should've retrieved the api credentials for a given shop during the registration/confirmation communication between the shop and your app server.
You can then use the same endpoints for writing data as they are used for every other entity, simply by changing the entity name to that of your custom entity within the endpoint URL.