Sharepoint - Break role inheritance and assign permissions to document with REST api?

In your comments you say you have made an attempt but can't break permissions inheritance in your workflow.

The answer to your question is yes, you can break permissions inheritance via the REST API from your SharePoint Designer workflow.

You will need to use the "Call HTTP Web Service" activity in your workflow and your URL will look like:

https://your_sp_site.sharepoint.com/_api/web/GetFileByServerRelativeUrl('<file relative url>')/ListItemAllFields/breakroleinheritance(true)

If you need help using the Call HTTP Web Service workflow activity you can find various guides like here, here, here, here and here.

Once you have broken permissions inheritance you can then assign your group to the document via the REST API using the AddRoleAssignment method. Again, you will need to use the "Call HTTP Web Service" workflow activity and your URL will look like:

https://your_sp_site.sharepoint.com/_api/web/GetFileByServerRelativeUrl('<file relative url>')/ListItemAllFields/roleassignments/addroleassignment(principalid=<groupId>,roledefid=<targetRoleDefinitionId>)

The first link you posted has good information. You can also find an excellent answer with examples for a similar question on this site here:

Manage File permissions using REST API


I'd finished this task with SharePoint 2010 Designer workflow without REST API. Click here for Link

final URL : Click here for the full article which can explain in details