The exact REST calls to create relations depend on both elements you want to connect: Defects could e.g. be linked to requirements, test run, ... Your defects will be linked to which entity type?
As far as I know you can create relations from both entities - either link the defect to a test run or a test run to the defect.
You might have a look at the GDPR Content Pack (download at https://marketplace.microfocus.com/appdelivery/content/gdpr-content-pack). The Excel sheet "Octane Fields" lists all fields for Octane entities including a description. If you filter that sheet for "defect" you'll currently find 94 fields; e.g.:
- parent: A reference to the item under which an entity was opened.
- dependence: The work items that depends on the entity.
- linked_items1: Backlog Items
- linked_items2: Defect(Trace from)
- requirements: The requirements covering this entity.
- covering_tests: A numeric field that shows the number of tests linked to this defect
The code to create Octane relations is in module modOCT, subOCTCreateRelation.