How to relate the document to ticket

when i upload a document into crm it will be created in collaboration documents section. I want to link that document to the appropriate ticket. I want to know the endpoint to link the document to the ticket.