Sign in

Upload a file to a folder

documented

Add a file to a folder (overwrite if exists).

POST {site_url}/_api/web/GetFolderByServerRelativeUrl('/path/to/folder')/Files/add(url='filename.ext',overwrite=true)Filesno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://{{$site_url}}/_api/web/GetFolderByServerRelativeUrl('/{{$server_relative_path}}')/Files/add(url='{{$filename}}',overwrite=true)" \
  -X POST \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "Accept: application/json;odata=verbose" \
  -H "X-RequestDigest: {{$form_digest_value}}" \
  -H "Content-Type: {{$mime_type}}" \
  -T "{{$local_file_path}}"
Upload a file to a folder · Microsoft SharePoint · OpenIntegrations