Skip to main content

Attach File (From URL)

POST /public/action/attachments/createFromUrl

Fetches a file from a URL and attaches it to a record.

Authentication: X-API-KEY header (see Authentication).

Query parameters​

ParameterTypeRequiredDescription
idstringYesId of the record to attach the file to, or the FileAsset folder ID when type is FOLDER.
typeenumYesObject type: CLIENT, PROJECT, DELIVERABLE, OPPORTUNITY, EXPENSE, TICKET, FOLDER.
fileUrlstringYesPublicly reachable URL of the file to fetch.
fileNamestringYesName to store the file under.

Request​

curl -X POST "https://api.withmoxie.com/public/action/attachments/createFromUrl" \
--data-urlencode "id=FOLDER_ID" \
--data-urlencode "type=FOLDER" \
--data-urlencode "fileUrl=https://example.com/file.pdf" \
--data-urlencode "fileName=file.pdf" \
-H "X-API-KEY: your_api_key_here"

Upload into a folder​

Set type=FOLDER and id to the existing FileAsset folder ID in the API key's workspace. This works for nested folders and does not require MCP. The folder ID is distinct from a client, project, or task ID. Missing folders, folders from another workspace, deleted folders, and folders beneath a deleted parent are rejected.

Uploading the same filename into the same folder adds a new file version. The response is a temporary signed download URL.

Response​

Returns the stored file reference / URL as a plain string.

"https://files.withmoxie.com/10016/clients/66b0f2a1.../contract.pdf"