Welcome to the Airtable community!
You can find documentation for the APIs here. The exact details depend on the API (scripting, REST, or custom apps). However, in general,
to upload a document to an attachment field, the document must exist at a publicly accessible url.