Sending a message via the API uses the "transfer" action type. You can use the "send a message" schema as a guideline for the options.
In some cases you may want to upload a document first and then use the URL for that document in your message rather than send the document as an attachment. This is particularly useful when sending emails, as attachments can be the cause of a failed delivery as email administrators try to reduce spam. For this purpose you should refer to the "Uploading a document" schema.